I have a problem with vlookup using multiple criteria. I have a sheet with my model, sheet with my parameters and sheet with lapses.
In sheets model I'am using vlookup function as follows:
VLOOKUP(Parameters_new!$C$3&"|"&H16;CHOOSE({1,2};lapses_monthly_2018!$B:$B&"|"&lapses_monthly_2018!$C:$C;lapses_monthly_2018!$D:$D);2;0)
where:
Parameters_new!$C$3 is code of my product, column H16 is month from the start (1,2,3....), lapses_monthly_2018!$B:$B is another different sheet, where in column B is my product, column C is the month and in column D is my final value, I´m trying to get. I always get a value "not available".
This should do it:
{=INDEX(lapses_monthly_2018!$D:$D,MATCH(1,(lapses_monthly_2018!$B:$B=Parameters_new!$C$3)*(lapses_monthly_2018!$C:$C=$H$16),0),1,1)}
Be aware - this is an array formula, so to get the curly brackets to show and initiate the array, you must execute the formula with control&shift&enter
Related
I want to concatenate the value of two columns in the current sheet and then result should be compared with the concatenation of two column value in another sheet.
e.g - The entered value in Column W and X in current sheet after concatenation should be compared with the existing value in column Y and column Z(after concat) of another sheet.
I have tried using the formula COUNTIF(Sheet2!CONCAT($W$2,$X$2:$Y$2,$Z$2),A2)>0 and some different alteration in this but it seems COUNTIF has range and criteria as argument and this is string which is causing error.
If you want to compare, a simple '=' will do.
Concatenation can be done using '&'.
in current sheet:
=W1&X1=Sheet2!Y1&Sheet2!Z1
will return TRUE if both concatenations are equal and FALSE if they are not.
To find the value W1&X1 in the entire range, I suggest you use a help column (unless you are willing to write a macro). In the help column of sheet1, you concatenate the values (=W1&X1 - drag down). In the hlep column of sheet2 you do the same. Then you make an additional column to check for matches, by using
=match(ValueHelpColSheet1,HelpColSheet2,0)
This formula returns the row number in which the match is found and an error when the corresponding value is not found. You can replace this error with something else using IFERROR if you want to.
I am using index(match(match to find a value based on two different criteria. There are many results that will populate, I just want to return the first result. What do I need to add to my Index Match formula in order to return the first result that matches?
Below is my code and a breakdown with images:
=INDEX(Master_Query[Current Balance On Hand],MATCH('Waterfall 2018'!$R$1086,Master_Query[Part Number],0),MATCH($BX$1,Master_Query[Date],0))
Cell H1086 is were i need the result to return. I need it to match the highlighted criteria: Part Number in cell R1086 and Date in cell BX1
This is the table that we get the results from, as you can see there are many results that match the criteria in the formula, i just want to return the first one since they are all the same.
Note: The date column is filtered; there are multiple dates that will result in different "current balance on hand"(column D) results, thus I cannot use a vlookup formula. I just filtered it to make it easy to understand my problem.
Attempt 1
Attempt 1(2)
The second Match looks for the column number in the index formula. So it doesn't do what you want.
One alternative is to add a column to the ELX forecast table that merges the "Date" column and the "Part number"
The formula of that column would be:
After that, in your waterfall sheet, replace your current index/match formula with:
=INDEX(Master_Query[Current Balance On Hand],MATCH(BX$1 & $R1086,Master_Query[Merged column],0))
I am trying to create a simple VLOOKUP function for my spreadsheet using the below:
In the first sheet
=VLOOKUP("Salary",'December 2015_natwest_download'!$D$4:$E$43,1,FALSE)
This is the sheet i am trying to reference:
The sheet I am trying reference:
Value Category
======= ==========
£530.00 Charlotte Owing
-£53.00 Gym
-£16.47 Water
-£67.00 Phone
-£11.01 Presents
-£14.40 Eating out
-£100.00 Food
-£65.00 Other
But when I put the VLOOKUP code into my excel, it returns NA. Can anyone see what is causing the error?
The VLOOKUP function is designed to lookup a value on the far left of a block of data and return a corresponding value from a column to the right.
If you need to lookup a value and return a value from a corresponding column to the left of the lookup column, you need to use an INDEX/MATCH function pair.
If you are returning numbers based on a condition (either in that column or another column) either the SUMIF or
SUMIFS function will do. Individual entries can be easily collected but if there is more than a single match to your condition, you will receive a sum total of the matching numbers.
The formulas in E4:F4 are,
=INDEX('December 2015_natwest_download'!A:A, MATCH(D4, 'December 2015_natwest_download'!B:B, 0))
=SUMIFS('December 2015_natwest_download'!A:A,'December 2015_natwest_download'!B:B, D4)
Note that the SUMIFS in F5 is returning two Gym entries.
I have a if formula with a number of criterias it has to match.
When I have shortened the formula down it works from beyond - IF(LEFT(A6,1)="2"
but there are no reasons it should error at this point? Any help?
=IF(LEFT(A6,2)="10","Area 1",IF(LEFT(A6,2)="12","Area 2",IF(LEFT(A6,2)="13","Area 3",IF(LEFT(A6,2)="14","Area 4",IF(LEFT(A6,2)="15","Area 5",IF(LEFT(A6,2)="16","Area 6",IF(LEFT(A6,2)="17","Area 7",IF(LEFT(A6,1)="2","Bulk",IF(LEFT(A6,1)="4","Intl",IF(LEFT(A6,2)="7","CGCC","Ad-Hoc"))))))))))
You can try combining IF and VLOOKUP.
=IF(LEFT(A6,1)="4","Intl",IF(ISNA(VLOOKUP(LEFT(A6,2),{"7","CGCC";"10","Area 1";"12","Area 2";"13","Area 3";"14","Area 4";"15","Area 5";"16","Area 6";"17","Area 7"},2,FALSE)),"Ad-Hoc",VLOOKUP(LEFT(A6,2),{"7","CGCC";"10","Area 1";"12","Area 2";"13","Area 3";"14","Area 4";"15","Area 5";"16","Area 6";"17","Area 7"},2,FALSE)))
I embedded the array in the formula but you can prepare a table (assume G1:H7) like this:
and then use the VLOOKUP with the reference:
=IF(LEFT(A6,1)="4","Intl",IF(ISNA(VLOOKUP(LEFT(A6,2),G1:H7,2,FALSE)),"Ad-Hoc",VLOOKUP(LEFT(A6,2),G1:H7,2,FALSE)))
IFNA or IFERROR could also be used but they are not available in Excel 2003.
Your entire formula could be shortened to 2 VLOOKUP functions, by putting your data into a table, with your ID column on, say, column A of sheet2, and your results column on column B of sheet2. This would look as follows:
=IFERROR(VLOOKUP(LEFT(A6,2),'Sheet2'!A:B,2,0),IFERROR(VLOOKUP(LEFT(A6),'Sheet2'!A:B,2,0),"Ad Hoc"))
What this does is: first try to match the left 2 characters in A6 to one of your ID's in column A in sheet2. If that creates an error, it tries to match the left 1 character in A6 to one of your ID's in column A of sheet2. Either way, it returns the matching value in column B of sheet2. If no match is found, it returns "Ad Hoc".
Sorry about the heading but im finding it hard to explain so ill give it my best shot.
Here is my problem
I have 3 cells: Lender, product and productID I have a vlookup that fills the lender and product cells just fine
However i want a way to bring back the productID back from another worksheet matching with lender and product.
For instance if call1 = newcastle and cell2 = 2 year fixed then cell3 = 422
I tried using a vlookup but doesnt seem to work, Any help on this would be greatly appreciated. Thanks
You can use Index and Match to perform a lookup with two criteria. Here is an example of one from http://blog.contextures.com/archives/2012/07/12/check-multiple-criteria-with-excel-index-and-match/
=INDEX($D$2:$D$10,MATCH(1,(A13=$B$2:$B$10)*(B13=$C$2:$C$10),0))
As mentioned on the site, it is an array formula so rather than just pressing enter when you use the formula, you need to hold Ctrl+Shift+Enter.
To break down how the formula is formatted:
=INDEX(a,MATCH(1,(b=c)*(d=e),0))
a = The whole range with all the data in it
b = The first criteria for the data to be filtered on
c = The range in which the first criteria needs to be searched
d = The second criteria for the data to be filtered on
e = The range in which the second criteria needs to be searched
Make sure that you use $ in the correct places as in the above example.
Another alternative to using combination of the MATCH and INDEX functions that some may find more straightforward is to first insert a column on your lookup table and concatenate the cobmination of columns you wish to search by.
=CONCATENATE(B8,C8)
Then you can still use the Vlookup function, but instead of only entering the one column to lookup on, you would combined them in the lookup so that the combination of them looks up to the combination of them on the lookup table.
=VLOOKUP(B3&C3,A9:D10,4,0)
Let's say that Newcastle is in A2 and 2 year fixed is in B2. It doesn't matter what worksheet they are on.In another worksheet named Data you have a table with a column of lenders in column X, products in column Y and product IDs in column Z. There are column labels in row 1 so the real data starts in row 2 and there are 2587 rows of data. In the first worksheet's C2 where you want the double lookup for a ProductID that matches Lende and Product try this formula.
=IFERROR(INDEX('Data'!$Z$2:$Z$9999, MIN(INDEX(ROW($1:$9998)+(('Data'!$X$2:$X$9999<>$A2)+('Data'!$Y$2:$Y$9999<>$B2))*1E99,,))), "no match")