VLOOKUP TRUE ISSUE - excel

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

Related

Why does this VLOOKUP result in an #N/A error?

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

Index Small and If in Excel for multiple criteria

Hi All I have been trying to use the formula below and to alter it for multiple conditions
{=INDEX($C$1:$C$51,SMALL(IF($A$1:$A$51="Adeline",ROW($A$1:$A$51),""),3),1)}
I have a table on sheet1 called Data and a page for calculations. There is a matching ID on both sheets though in the table on sheet1 an ID could be on multiple rows. Also the CODE column could contain in this case TEST2 multiple times for same ID but with different Values. I am trying to in this case find the 3rd value for this combination.
So I trying to find out a value based on ID and a column called Code but I would like the 3rd value
So I've tried altering the IF part of the statement
{=INDEX(Data[Value],SMALL(IF((Data[ID] =[#ID])*(Data[CODE] = "Test2") ,ROW($A$1:$A$51),""),3),1)}
and
{=INDEX(Data[Value],SMALL(IF((AND(Data[ID]=[#ID], Data[CODE] = "Test2") ,ROW($A$1:$A$51),""),3),1)}
Both Come up with errors - any advice or am I looking at this completely in the wrong way.
Sample Data
Calcs sheet
EDIT Change from Largest being the highest rank to Smallest being the highest rank
=IFERROR(AGGREGATE(15,6,1/(1/((Data[[ID]:[ID]]=Results[#[ID]:[ID]])*(Data[[Code]:[Code]]="Test 2")))*Data[[Value]:[Value]],COLUMNS($A:A)),"")
Notes:
We use multiplication of Booleans instead of an IF function
the 1/(1/(...)) formula part is a method of turning FALSE results from the Boolean multiplaction from 0 into a #DIV/0! error.
The AGGREGATE function provides a method of excluding the error results from the calculation.
Structured references have been changed to absolute references to allow dragging without changing the column names
The COLUMNS(... function will adjust to return {1,2,3] as you fill right to return the smallest; 2nd smallest, etc value
Note that with an absolute reference, the table name must be used even if the line is in the same table.

Match two columns in two excel files and return value [duplicate]

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.

Index match match - correct approach?

I have a data source in the format as the one below. In reality, that would contain few thousand rows.
I need to use something like INDEX-MATCH-MATCH in order to be able to get the "Status" for each "Content" item for each UserID.
The final result should look like this. The first two columns are not dynamic.
The INDEX formula goes to C and D.
I am using the following sequence to try and write the formula, but I don't seem to understand where the problem is.
=INDEX(Sheet1!A:K, [Vertical Position], [Horizontal Position])
look up the user with ID xxx:
=INDEX(Sheet1!A:K, MATCH(A2, Sheet1!A:K,0), [Horizontal Position])
look up the status for eLearn1.
=INDEX(Sheet1!A:K, MATCH(A2, Sheet1!A:K,0), MATCH("Status", Sheet1!A:K,0))
What am I doing wrong?
The question is not clear, but I think you are trying to do a LOOKUP based on the values of two columns. So for a particular value of Column A (UserID) and Column B (Content) you need to return Column H (Status).
This can be done using an array formula to return the row number of the matching line which can be fed into INDEX. Note, that this will only work as long as Columns A&B only have unique pairings.
I have set up some sample data:
Columns A-C are my source data. Cells G2:H4 are the lookup.
The formula is:
=INDEX($C$1:$C$7, SUM(($A$1:$A$7=$F2)* ($B$1:$B$7=G$1)*ROW($C$1:$C$7)))
This needs to be entered as an array formula by pressing CTRL-ALT-ENTER.
The formula works by matching the value you are searching for in both arrays and multiplying out the results. This should give you a result array consisting of all False with one True indicating the matched row. This is then multiplied against the row number to return the correct row to the INDEX formula.

Error using Vlookup function 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.

Resources