Lookup using IF/Match returning wrong values

sundodger

New Member
Joined
Aug 9, 2018
Messages
17
Hi Everyone,
I have a table in A22:E26, it has the categories A,B,C,D and E in row 22. In rows 23 to 26 it has values that i want to look up and return in cell B9.
The user inputs the value of the category they are in into B6. Either A,B,C,D or E.
They also input a value into E5, This decides which row the data is returned from. If the value in E5 is 0 to 26000, it would be the data in row 23, 26001 to 39000 Row 24, 39001 to 48000 row 25, 48001 and higher row 26. E.G category C at 48002 would return the value in C26, Category A at 10000 would return the value in A23 an so on.
I am using the formula
=IF(AND(E5>=MIN($K$4:$K$7), E5<=MAX($L$4:$L$7)), INDEX($A$23:$E$26, MATCH(B6, $A$22:$E$22, 0), MATCH(E5, $A$23:$A$26, 1)), "Invalid Input")
Which is the closest i have got to getting this to work.
However i keep getting the wrong cell returned as an answer.
E.G if i have Category D and a value of 27000 it should return the value in D24 but i get the value from A25.
I will try to upload a copy of the sheet later if needed.
Thanks
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Hello

Mappe5
ABCDEF
527000
6D
7
8
9169
10
11
12
13
14
15
16
17
18
19
20
21
22ABCDE
23348103215903650
241292487816911226001
2514626210535027139001
268928616916432148001
Tabelle1
Cell Formulas
RangeFormula
B9B9=CHOOSECOLS(XLOOKUP(E5,F23:F26,A23:E26,,-1,1),XMATCH(B6,A22:E22))
 
Upvote 0
Solution

Forum statistics

Threads
1,223,875
Messages
6,175,117
Members
452,613
Latest member
amorehouse

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