Vlookup not working and Index/Match repeating same data

HughT

Board Regular
Joined
Jan 6, 2012
Messages
113
Office Version
  1. 365
Platform
  1. Windows
I have looked for answers but can't get my head round this.

I want to use a value in a cell on a Calculator worksheet to lookup the same value in a cell in a column on a Data worksheet and return a value from a cell on the same row of the Data worksheet. The lookup value is a simple month year reference eg 04/20 for April 2020. I then want to drag this lookup formula down it's column of the Calculator worksheet so the reference number on each row looks up the same value on the Data worksheet and returns a value from the appropriate row. Sounds like out of the box Vlookup, but it doesn't work because neither the reference values on the Calculator worksheet nor the values on the Data worksheet can be in ascending order (the data is input by others from a management system and the order can't be changed eg by a sort). The returned value is monetary and can be any value including zero and negatives. Both the lookup and the data orders are randomised. So Vlookup returns either duplicate values, zeros or #N/A errors. I have tried using True instead of False in the formula but this understandably returns errors, so Vlookup would not appear to be an option.

I have tried using Index/Match, but this returns the same value multiple times. What is interesting is that the value it returns for the first row of the Calculator worksheet is not the correct value for the corresponding Data worksheet. Even though the first reference number on the Calculator worksheet is 03/18, and is coincidentally the reference number for the first row on the data worksheet, the formula is returning the data for 02/18 which is on the sixth and last row of the Data worksheet. But 02/18 does not occur on the Calculator worksheet at all. So the formula would appear to be looking for the lowest value reference even though it is not being asked to! Even though other lookup references on the Calculator worksheet are present on both the Calculator and Data worksheets, (eg 04/18, 06/18 etc) they all return the value for 02/18.

I don't know if this is relevant, but the reference on the Calculator is a formula, looking up data from another column based on a rule..

The formula in the Calculator worksheet is: INDEX('DATA'!$T$11:$T$59,MATCH($M16,'DATA'!$C$11:$C$59).

The value I want returned is in column T of the Data worksheet. The lookup value is in M16 of the Calculator worksheet, the lookup range (containing the mm/yy data) in the Data worksheet is C11:C19. The values to be returned are in the range T11:T59.

It had occurred to me that either the Vlookup or Index/Match solutions could work if there were two helper columns that could automatically order the data in Column C and T of the Data worksheet so that they were in ascending order (ie the first helper column would automatically order the data in column C so that Vlookup would work, but the data in the second column would also have to reorder the data in Column T to match). I don't know if this is feasible!

Many thanks

HughT
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Hi,

Some data samples would be nice.
As for INDEX+MATCH there is a parameter missing. MATCH has 3 parameters:
- value to be found
- range to be searched
- value to return (less then, exact, greater then)
You missed last parameter which means that MATCH returns relative position of searched value. If you want exact value you need to add 0 to the formula:
=INDEX('DATA'!$T$11:$T$59,MATCH($M16,'DATA'!$C$11:$C$59,0)
 
Upvote 0
Phenomenal! I knew it would be something daft. Thank you very much!

HughT
 
Upvote 0

Forum statistics

Threads
1,215,002
Messages
6,122,652
Members
449,092
Latest member
peppernaut

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top