I am doing quotations in Excel for my company and I am trying to find a way to do 2 things:
aggregate several quantities of the same product based on its reference number
return several values for the same references (i.e. different prices)
I was thinking about using VLOOKUP but I cannot find a way to make it sum or return multiple values.
Table outline in the picture attached here, the wanted result would be:
- for the 1st function: sum up the table into 3 lines with aggregated quantities for products X Y Z
- for the 2nd function: sum up the table into 4 lines with the prices for products X Y Z (X having 2 different prices in the sample data, but I would need the function to be able to return as many lines as there are different prices for the same product)
Thank you very much for you help!
Kind regards,
Antoine
Edit: to get a better idea of what I try to achieve, here is another picture:
2nd pic with annotations
Quantities of the same product have to be aggregated, except if the unit price is different.
Could price difference be based on a subreference to be added to the first table? That would need the vlookup to match 2 values to return a result, is that feasible?
Noting that I do not have control over the source data for unit price, meaning that reference and subreference would have to be in different columns rather than concatenated.
The goal is to produce a recap table rather than filter out single values as suggested in the answer.
So, try this:
Cell B10 is the product you want to look at then G2 is the test if the product on that row matches. Finally, the sumproduct calculates the total, but you can change which column it looks at, I just chose the total column.
Now showing use of data validation from a list:
Related
I have two tables and want to take a row of one and a column of the other as two arrays, then multiply first with first, second with second... and sum up all those products.
This is what I got:
=SUMPRODUCT(OFFSET(Rezepte; MATCH([#Cocktail]; Rezepte[Cocktail]); 1; 1; 36); OFFSET(Zutaten; 0; 1; 36; 1))
As you can see I try to take arrays from my tables using OFFSET and calculate my answer using SUMPRODUCT
It returns "A value in this formula is the wrong data type", however when I put the either one of the inner OFFSET functions twice instead of the other one, it works just as intended. So there seems to be some incompatibility there.
The first table contains recipes for cocktails, each cocktail has a row of values for the measures of all ingredients. The second table lists all ingredients and what their price per liter is (currently dummy values). I want to multiply the measures with the prices and add the values to calculate the price for each cocktail. I know, it's kind of an odd use case :)
And here is what the tables look like:
Table one, of which I want to take one row
Table two, of which I want to take one column
Table three, in which I want the answer to be displayed
When using SUMPRODUCT() on a row and column, I use TRANSPOSE():
=SUMPRODUCT(A1:C1,TRANSPOSE(E3:E5))
I would like a formula to display the average from the filtered values in Excel. For example, I have a data with 4 columns. Column A-Product, Column B-Week, Column C-number of unit tested and Column D-Yield. In column A, I have hundreds of product that could belongs to several group. As of now, I have created another column Average showing the average yield value for each product by using the AVERAGEIF function "=AVERAGEIF([Product],[#[Product]],[Yield])".I manage to get the average yield value for each products.
But now, I want to randomly group few products and see the average value. The group should not be pre-determined. For example, I want to select X3000, A and AL using the filter function. The formula should give me the average for this three products which is 0.6786 not the average of individual product. The same formula should work if I want to select only product X3020 and A by using the filter function in Excel.
This is the example of data that I'm working on right now.
PRODUCT|WEEK|#TESTED|YIELD|AVERAGE
X3000|WEEK-12|2|100%|1
X3000|WEEK-13|1|100%|1
X3020|WEEK-6|7|71.43%|0.7712
X3020|WEEK-10|11|82.81%|0.7712
A|WEEK-12|7|0%|0.6667
A|WEEK-13|2|100%|0.6667
A|WEEK-14|1|100%|0.6667
AL|WEEK-7|16|75%|0.3750
AL|WEEK-9|2|0%|0.3750
I have a large data set(over 1 million rows) of patient names, problems/diagnoses, and the dates these diagnoses were entered(with each variable as a column header).
I would like to pull data from this source file to add to an existing file which has about 900 unique patient names with other demographics(in columns).
I am not able to use the vlookup function because most patients have multiple problems.
Are there any other functions or tricks which might be helpful?
Thanks in advance for your time and efforts.
Sample of what Data Currently looks like:
Name Diagnosis Date of Dx
A Head 11/15/12
B Leg 09/08/14
B Elbow 10/11/15
C Hand 02/23/16
A Toe 04/11/13
A Eye 05/25/15
C Ear 12/21/14
What I would like Data Set to Look like:
Name Dx#1 Date#1 Dx#2 Date#2 Dx#3 Date#3
A Head 11/15/12 Toe 04/11/13 Eye 05/25/15
B Leg 09/08/14 Elbow 10/11/15 n/a n/a
C Hand 02/23/16 Ear 12/21/14 n/a n/a
I'm not sure if you're familiar with the index and match functions, but you can use those to create the sheet. The easiest way would be to add several helper columns (in your example 3) and use the match function to get the reference row that you want.
From there you can offset the search range by previous match to find the next match. You can do this as many times as necessary depending on the number of conditions a patient has.
After that it's a simple index function to fill in the rows of the table with the desired values. You can clean up the extra cells with iferror if you want.
Assuming your data is in columns A1:C8, and your output dataset is in columns E1:K4, the following formulas will give you the desired output. The helper columns are found in L1:N4. These formulas would go in row 2, but you can drag them down to calculate for the rest of the rows.
I'll add the column above each formula:
E
No formula, list all patient names
F
=INDEX(B:B,L2)
G
=INDEX(C:C,L2)
H
=IFERROR(INDEX(B:B,M2),"")
I
=IFERROR(INDEX(C:C,M2),"")
J
=IFERROR(INDEX(B:B,N2),"")
K
=IFERROR(INDEX(C:C,N2),"")
L
=MATCH(E2,$A$1:$A$8,0)
M
=IFERROR(MATCH($E2,OFFSET($A$1,L2,0,COUNTA($A:$A)-L2),0)+L2,"")
N
=IFERROR(MATCH($E2,OFFSET($A$1,M2,0,COUNTA($A:$A)-M2),0)+M2,"")
Hope this helps, and let me know if you have any questions about the formulas.
My data table is like the image above. I can easily count the number of Male participants in group B or C using this array formula:
=SUM(COUNTIFS($B:$B, $E3, $C:$C, $F3:$F4))
The result is 3 as expected. However I'm gonna do the reverse thing, that is count the number of Male participants in NOT group B or C. The result should be 1 but currently I'm stuck at this.
Can anybody show me a way please (preferably not just counting the number of all Male participants and then do a subtraction)? I have even tried to change the values in the Group to something like <>B and <>C but it just doesn't work.
As you only have 2 in the group you can easily use COUNTIFS with 2 separate criteria, i.e.
=COUNTIFS($B:$B,$E3,$C:$C,"<>"&$F3,$C:$C,"<>"&$F4)
but clearly that might not be desirable for a large group, so you could use SUMPRODUCT like this to reference the group once
=SUMPRODUCT(($B:$B=$E3)*ISNA(MATCH($C:$C,$F3:$F4,0)))
ISNA will exclude matching rows - to include use ISNUMBER
You can replace F3:F4 with any single row or column of values
Note: whole columns with SUMPRODUCT will work (post Excel 2003) but is undesirable as Jerry says
Hmm, the thing with the formula right now is that the first COUNTIFS (for F3) will return 2 and the second COUNTIFS (for F4) will return 3, which SUM converts into 5 when you try:
=SUM(COUNTIFS($B:$B, $E3, $C:$C, "<>"&$F3:$F4))
I would suggest using SUMPRODUCT instead:
=SUMPRODUCT(($B:$B=$E3)*($C:$C<>$F3)*($C:$C<>$F4))
And maybe make the range smaller since this can take some time (you don't need to insert this as an array formula).
Otherwise, another option would be to count all the Males, and then subtract the counts for group B and subsequently C:
=COUNTIF($B:$B, $E3)-SUM(COUNTIFS($B:$B, $E3, $C:$C, $F3:$F4))
This is a confusing request.
I have an excel tab with a lot of data, for now I'll focus on 3 points of that data.
Team
Quarter
Task Name
In one tab I have a long list of this data displaying all the tasks for all the teams and what Quarter they will be on.
I WANT to load another tab, and take that data (from the original tab) and insert it into a non-list format. So I would have Quarters 1,2,3,4 as columns going across the screen, and Team Groups going down. I want each "task" that is labeled as Q1 to know to list in the Q1 section of that Teams "Block"
So something like this: "If Column A=TeamA,AND Quarter=Q1, then insert Task Name ... here."
Basically, if the formula = true, I want to print a list of those items within that team section of the excel document.
I'd like to be able to add/move things around at the data level, and have things automatically shift in the Display tab. I honestly have no idea where to start.
If there is never a possibility that there could be more that 1 task for a given team and quarter, then you can use a formula solution.
Given a data setup like this (in a sheet named 'Sheet1'):
And expected results like this (in a different sheet):
The formula in cell B2 and copied over and down is:
=IFERROR(INDEX(Sheet1!$C$2:$C$7,MATCH(1,INDEX((Sheet1!$A$2:$A$7=$A2)*(Sheet1!$B$2:$B$7=B$1),),0)),"")
I came across this situation. When I have to insert the values into a table from an Excel sheet I need all information in 1 Column instead of 2 multiple rows. In Excel my Data looks like:
ProductID----OrderID
9353510---- 1212259
9650934---- 1381676
9572474---- 1381677
9632365---- 1374217
9353182---- 1212260
9353182---- 1219361
9353182---- 1212815
9353513---- 1130308
9353320---- 1130288
9360957---- 1187479
9353077---- 1104558
9353077---- 1130926
9353124---- 1300853
I wanted single row for each product in shape of
(ProductID,'OrdersIDn1,OrderIDn2,.....')
For quick solution I fix it with a third column ColumnC to number the Sale of Product
=IF(A2<>A1,1,IF(A2=A1,C1+1,1))
and fourth Column D as a placeholder to concatenate with previous row value of same product:
=IF(A2=A1,D1+","&TEXT(B2,"########"),TEXT(B2,"########"))
Then Column E is the final column I required to hide/blank out duplicate row values and keep only the correct one:
=IF(A2<>A3,"("&A2&",'"&D2&"'),","")
Final Output required is only from Column E
ProductID Order Id Sno PlaceHolder Required Column
9353510 1212259 1 1212259 (9353510,'1212259'),
9650934 1381676 1 1381676 (9650934,'1381676'),
9572474 1381677 1 1381677 (9572474,'1381677'),
9632365 1374217 1 1374217 (9632365,'1374217'),
9353182 1212260 1 1212260
9353182 1219361 2 1212260,1219361
9353182 1212815 3 1212260,1219361,1212815 (9353182,'1212260,1219361,1212815'),
9353513 1130308 1 1130308 (9353513,'1130308'),
9353320 1130288 1 1130288 (9353320,'1130288'),
9360957 1187479 1 1187479 (9360957,'1187479'),
9353077 1104558 1 1104558
9353077 1130926 2 1104558,1130926 (9353077,'1104558,1130926')
You will notice that final values are only with the Maximum Number of ProductSno which I need to avoid duplication ..
In Your case Product could be Team and Order could be Quarter and Output could be
(Team,Q1,Q2,....),
Based on my understanding of your summary above, you want to put non-numerical data into a grid of teams and quarters.
The offset worksheet function will work well for this in conjunction with the match or vlookup functions. I have often done this task by doing the following steps.
In my data table, I have to concatenate the Team and quarter columns so I have a unique lookup value at the leftmost column of your table (Note: you can eventually hide this for ease of reading).
Note: You will want to name the input range for best formula management. Ideally use an Excel Table (2007 or greater) or create a dynamically named range with the offset and CountA functions working together (http://tinyurl.com/yfhfsal)
First, VLOOKUP arguments are VLOOKUP(Lookup_Value,Table_Array,Col_Index_num,[Range Lookup]) See http://tinyurl.com/22t64x7
In the first cell of your output area you would have a VLOOKUP formula that would look like this
=Vlookup(TeamName&Quarter,Input_List,Column#_Where_Tasks_Are,False)
The Lookup value should be referencing cells where you have the team names and quarter names listed down the sides and across the top. The input list is from the sheet you have the data stored. The number three represents the column number the tasks are listed in your source data, and the False tells the function it will only use an exact match in your putput.