Question: How to sum all values based on matching values in a range?
(I would like to avoid using Pivot Table)
Hence, all "Volume" in Table 2 should be summed based on "dest_ctry" in Table 1.
Thank you.
Use simple SUMIF() like-
=SUMIF(C5:C100,F5,D5:D100)
If your data in true table object then use-
=SUMIF(Table1[dest_ctry],[#Destination],Table1[Volume])
Related
Given Table 1, I am able to calculate the sum of the revenue with the SUMPRODUCT formula. Though, I would like to be able to filter out specific areas directly in the formula. The formula listed below gives the correct result (13,000) when area B is filtered out of the data with:
=SUMPRODUCT(--(Sales[Area]<>Exceptions[Area]);Sales[Quantity];Sales[Price per unit])
However, when I add another area in Table 2, the formula returns an error. Is it possible to filter out multiple variables (areas) directly in the formula?
Use ISERROR(MATCH()):
=SUMPRODUCT(--(ISERROR(MATCH(Sales[Area];Exceptions[Area];0)));Sales[Quantity];Sales[Price per unit])
--(ISERROR(MATCH(Sales[Area];Exceptions[Area];0))) will return 1 if the area is not found in the search area, because the MATCH will return an error when it is not found in the list.
I am building an RFM table in excel, and want to lookup against a score table I created. Using row 3 as an example in the pic below, when I use the vlookup true function which is supposed to return a close match from the recency rankings table the vlookup is pulling in a 5 in column F, instead of a 1. I am not looking to do an exact match as that is not how this analysis is structured.
Any thoughts on why the true statement in the vlookup is not returning correct values? Any thoughts on how to fix would be appreciated.
enter image description here
When you use TRUE as the final parameter in VLOOKUP (for "approximate match"), Excel (for whatever reason) stipulates that the corresponding values in the first column of the lookup range must be in ascending order. The prompt as you're typing the formula notes this
Therefore, re-order your lookup table and then the VLOOKUP values should populate as you expect them to
I'm trying to do a Lookup formula to get get the exact value based on two fields against 3 fields (two of the lookup fields are Min and Max fields) so the idea is to get the value based on field name and another numeric field against two fields because it is a range of numbers
Lookup Table
Table where formula will be created (Inside LookupResult). See below the expected result where Price 150 for 101-A-A should be ABCD
Thanks for the help
You just need some indexing, no need for MATCH nor VLOOKUP. For example:
Formula in H2:
=INDEX(D:D,MAX(INDEX((A$2:A$3=F2)*(B$2:B$3<=G2)*(C$2:C$3>=G2)*ROW(A$2:A$3),)))
Or, if rules can really only apply to a single row:
=INDEX(D:D,SUMPRODUCT((A$2:A$3=F2)*(B$2:B$3<=G2)*(C$2:C$3>=G2)*ROW(A$2:A$3)))
Here is a simplified version. I was trying to match the shop grade from a given table to the data but it returned error, what's wrong with my vlookup function? I'm an Excel beginner.
The data:
The given table:
You are trying to match Column B so your lookup range should start with that:
=VLOOKUP(B2,Table!B2:C3,2,False)
Vlookup requires the first column to be the lookup column.
You have to look up by referencing the first column in the table. In this case, change B2 to A2 and it will work.
What is vlookup?
Does a lookup for a specified value in the left most column of a specified table(table_array) vertically from top to bottom and returns a value from one of the columns(column_index_number) of the table. Formula follows
VLOOKUP(lookup_value,table_array,column_index_number,[range_lookup])
These are common pitfalls with vlookup.
If table A is used to lookup and table B is getting populated with values
Lookup value is not first column of table array(table A)
Lookup column on table array is not sorted - sort using excel sort function in Data tab
Dragging the formula would have caused Table array to shift for each lookup in table B. E.g A1:C10 may become A2:C11 for second lookup and can result in #NA if lookup result falls in top rows which is missing. Use $A$1:$C$10 as lookup array table A to make sure that formula is not affected while dragging the cells. Alternately, naming table array can also be employed.
Range lookup true can result in getting invalid results even when no result is present in table A. Using range lookup false will be accurate in most cases.
Reference :
MS Office vlookup help
Named tables in Excel
I have the following data set:
I calculate the maximum return using =max(B2:B13) in cell D3 (i.e., 13.55%), and then I would like to find the date where this maximum return was realized. Thus, I use =vlookup(D3;A2:B13;1;FALSE), and I get as a result #N/A, which is clearly wrong. How can I make this work?
You can't use a VLOOKUP to find a value that isn't in the first column of your data table. Use an INDEX/MATCH formula instead:
=INDEX(A2:A13,MATCH(MAX(B2:B13),B2:B13,0))
A VLOOKUP is a Vertical Lookup - and is used to look up a value in the first column of a table and return a corresponding value from another column in that table (just like looking at a timetable for example).
You are trying to find the max value from column B, in column A - where it doesn't exist so you're not going to find it. In order to use a VLOOKUP the lookup_value must be in the first column of the data table.
If you want to look up a value in another column of the data table, then you need to use =INDEX(MATCH()) instead.