I have the following format for my data. The bolded items on the left are what I am trying to make, items in column C are the materials needed, and column B are the quantity of that material. In column G I have a unique list of items which I want to correspond to their total quantities in column F.
Techniques I've already tried that didn't work:
VLOOKUP
SUMIF
SUM
IF
COUNTIF
Pivot Table
Combination of all of the above.
I've already stumped two of my Business major friends and I've watched a dozen tutorials which are way simpler than what I'm trying to do here.
Try this
=SUMIF(C:C;"="&$G2;B:B)
EDIT based on Wyatt Shipman comment
=SUMIF(C:C;$G2;B:B)
Related
I have a pivot table with employees names, their grand totals of cases worked for the month, the days they worked during the month, and the case counts for each day.
I have them all stacked on top of each other on a sheet for fast viewing.
I created a column to countif Column (A) has a partial text value that matches the month.
In that column (AR) it returns 1 for true and 0 for not true.
I'm trying to create a formula where it sums up the 1s between the 0s.
The picture is horrible due to the size limits.
Basically, I need to count the days the employee worked and find the average case count for the month for each employee.
I can't use the average function in the pivot table because the count is based on IDs.
I tried If statements, and SumIfs.
ATTACHED IS A SAMPLE OF THE FILE I'M WORKING WITH
Picture of the Spreadsheet as requested
Sorry, i'm working on Excel in french. But I hope my answer with the file modified will help u understand what I'm talking about.
Here is your Excel sample with my modifications : Your Excel file that I modified
You can create another pivot table, that uses your previous pivot table as new datasource. But before doing that, make sure the elements of your first column "Claimed by" is repeated, by checking the column option "repeat element labels" like this :
In this new crosstab, you add as columns : the sum of "Case Count" ; and the count of "Days".
After that, you can filter the column "Claimed by" by selecting only elements without the word "total".
Then your average will be obtained simply by dividing the two columns.
I need to create a module that will count the amount of values in specified date ranges, with other criteria.
For example, I have a list of products (Products A, B , C, D) in column C, and their sale date in column G.
I need to count all of product A sold before 1/1/1998. I then need to calculate product A sold between 1/1/1998 and 1/1/2005 etc.
I need to be able to run this for all the types of products, and group products together.
E.g. count all of product A & B sold before 1/1/1998.
This has to be done for a new workbook on a weekly basis so ideally needs to be able to be run for a new workbook each week. The tab names always remain the same.
Any help on how to get started would be appreciated
This answer will assume that your dates are entered as excel dates in column G and not a text. You can test this by using the formula =ISNUMBER(G3) where G3 is one of your dates. If it returns true, then your date is properly stored for use by excel formulas and this answer.
=SUMPRODUCT((($C$1:$C$100="A")+($C$1:$C$100="B"))*($G$1:$G$100<Date(1998,1,1))
That is how to hard code it. Personally I would build a table. Each row of the table would be a product you are interested in knowing the count for and a sum of the count would give you combined totals. Repeat the table if you need multiple combinations.
In the following example a single product was counted and then the total for all products listed was the total. The formula for the example in L3 and copied down for each product was:
=SUMPRODUCT(($C$2:$C$9=$J4)*($G$2:$G$9<K4))
The total at the bottom of the table was a simple SUM formula. Because SUMPRODUCT performs array like operations, avoid using full column references and try to restrict it to the data that needs to be checked. Otherwise you may notice a slow down in your system as multiple excess calculations are being perfomed.
I have a bunch of rows in a table. Each row reflects an event in a patient. However, one patient can have experienced multiple events, so it's possible for there to be multiple rows with the same patient number. Now I'd like to count the amount of male patients in my database, without counting the ones that had multiple events multiple times. Each patient is identified by a unique patient ID that could be used for this.
This shouldn't be all that complicated if not for the fact that I'm using a table that also has several filters, so I need to use SUBTOTAL for any counting functions.
I literally have no idea where to start, so I can't really provide any code...
Any function that could point me in the right direction would be greatly appreciated.
Thanks for the help.
~Laurens
Use a Pivot Table to filter and count all your patients database. Select your data and select Insert -> Tables -> Pivot Tables. Put your filters at the Filter section of the table and the Patient ID in the Rows section. Then, you can use COUNT to get the number of patients.
For more information about Pivot Tables, you can check this: https://support.office.com/en-us/article/Create-a-PivotTable-to-analyze-worksheet-data-a9a84538-bfe9-40a9-a8e9-f99134456576
To get the number of unique IDs in the same column, if the IDs are numeric, you can use SUM with FREQUENCY:
=SUM(IF(FREQUENCY($A$1:$A$1000,$A$1:$A$1000)>0,1))
If they're text and numbers mixed, you can get unique IDs with this one:
=SUM(IF(FREQUENCY(MATCH($A$1:$A$1000,$A$1:$A$1000,0),MATCH($A$1:$A$1000,$A$1:$A$1000,0))>0,1))
(From here)
Here you go
You've not mentioned whether an event is optional.
You might want to add extra column H with formula like h2=if(c2="",0,1) with 1/0 and multiply it as well in G.
Basically if column G contains a 1 you include it
Here's what the results of the formula look like:
Revision
Table is sorted by Patient id..
on change of patient id column H contains a 1, it'll be 0 otherwise.
So H2 is hard coded to 1, H3,H4,H6 will evaluate to 1.
So now G2=H2*E2 etc. You can filter by column H.
The beauty of mapping things into binary zeros and ones is you can do multiplication to achieve a logical AND result, whilst at the same time breaking a complex task into a series of steps. You can then apply a filter to the data to get the rows where column G are not zero, and see the totals count. Normally I'd insert a column between header and data on row 2 and then have G2=SUM(G3:G9)
Sum column H for number of patients.
I have a list of actions in Excel, sorted by a couple of criterias by column, the 'key' or ID being the date it was added to the list. The relevant criterias are date in the A column, location, and category.
I want to follow-up on the actions listed by the criterias monthly. I have not gotten this function to work however, even after trying a couple of different functions. So basically I want to count the number of rows in column A (starting from row X, since the first columns are not included), that include the specific criteria from columns B and C. So I want to count the different categories separately, and each category by location.
The list of possibilities in B and C comes from a list that is used in data validation, so that the categories and locations are given in drop-down menus.
The follow-up is also on its own tab in the spreadsheet, and the list criterias on its own.
What I have tried so far is e.g. sumproduct with (--), countifs with the column and the expression (MONTH(A:A)=1) and (B:B;"criteriaX").
All of these give me a #VALUE!-error.
I needed some help with Excel functions as I am not really sure how to achieve this.
Basically, this picture shows my data structure:
I am aware that I can use Index& Match excel functions together for columns but I am not sure if it is possible use Index&Match together on two row conditions.
Requirement:
I have three products, product A, product B and Product C. I want to be able to quickly calculate the actual revenue and and you can see the data structure in the image above. My top-most row is month. For each month, I have 4 columns, of which 2 need to be calculated should the condition match.
This is the condition. An example, for product A, calculate the total sumproduct(multiples column actual customers x Price Actuals) for yearMonth 201501.
So basically,first, for product A, it would need to find YearMonth 201501, and when it is found, it should find columns Actual Customers and Price Actuals and return the SUMPRODUCT of Actual Customers and Price Actuals.
Is it possible to do this?
I have searched the Internet a bit and I have not found a solution.
Update:I thought I could post the follow-up question in the same thread insted of Cristiano duplicates... For the accepted answer, in the excel formula, how can it be divided by the total amount of "actual customers" for that month?
Simply adding "actual customers" with a slash before IT does not work.
You need a cell where you specify the month you want to look up. Give that cell the name "TheMonth".
You need a cell where you specify the product you want to look up. Give that cell the name "TheProduct".
Then, assuming your screenshot starts in cell A1, you can use
=SUMPRODUCT($B$3:$I$5*($B$1:$I$1=TheMonth)*(($B$2:$I$2="Actual Customers")+($B$2:$I$2="Price - Actuals"))*($A$3:$A$5=TheProduct))
Next time, please post a link to a workbook. It's not much fun typing in the text and numbers from a screenshot in order to verify a formula.
Here is the workbook with the formula in action.