INDEX MATCH Query - Return A Value From A Range Based On Two Criteria

jonsharman

New Member
Joined
Jan 4, 2014
Messages
28
Hi All,

I am trying to return a monetary value using INDEX MATCH based on two criteria that will search through a range of data - example of the sheet below:

DATALOOKUPRETURN
CO2PD116P£20.00
0 - 99£10.00£0.00
100 - 109£15.00£15.00
110 - 119£20.00£20.00
120 - 129£115.00£90.00
130 - 139£175.00£150.00

<tbody>
</tbody>

I have named the ranges CO2, P and D and in the above example I want to return the figure £20.00 based on looking for the value 116 which exists between 110 - 119 in the CO2 range and the P range. Likewise if I was to search for 135 and and D I would want to return £150.00

I have tried using TRUE to search for a near match but I get a #N/A error and I just cannot see what I am doing wrong.

Any help would be appreciated.

Thanks
 

Some videos you may like

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
Example:

<b>Excel 2010</b><table cellpadding="2.5px" rules="all" style=";background-color: #FFFFFF;border: 1px solid;border-collapse: collapse; border-color: #BBB"><colgroup><col width="25px" style="background-color: #DAE7F5" /><col /><col /><col /><col /><col /><col /><col /></colgroup><thead><tr style=" background-color: #DAE7F5;text-align: center;color: #161120"><th></th><th>A</th><th>B</th><th>C</th><th>D</th><th>E</th><th>F</th><th>G</th></tr></thead><tbody><tr ><td style="color: #161120;text-align: center;">1</td><td style=";">DATA</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style=";">LOOKUP</td><td style="text-align: right;;"></td><td style=";">RETURN</td></tr><tr ><td style="color: #161120;text-align: center;">2</td><td style=";">CO2</td><td style=";">P</td><td style=";">D</td><td style="text-align: right;;"></td><td style="text-align: right;;">116</td><td style=";">P</td><td style="text-align: right;;">£20.00</td></tr><tr ><td style="color: #161120;text-align: center;">3</td><td style="text-align: right;;">0</td><td style="text-align: right;;">£10.00</td><td style="text-align: right;;">£0.00</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">4</td><td style="text-align: right;;">100</td><td style="text-align: right;;">£15.00</td><td style="text-align: right;;">£15.00</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">5</td><td style="text-align: right;;">110</td><td style="text-align: right;;">£20.00</td><td style="text-align: right;;">£20.00</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">6</td><td style="text-align: right;;">120</td><td style="text-align: right;;">£115.00</td><td style="text-align: right;;">£90.00</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">7</td><td style="text-align: right;;">130</td><td style="text-align: right;;">£175.00</td><td style="text-align: right;;">£150.00</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr></tbody></table><p style="width:3.6em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid #BBB;border-top:none;text-align: center;background-color: #DAE7F5;color: #161120">Sheet1</p><br /><br /><table width="85%" cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: #FFFFFF" ><tr><td style="padding:6px" ><b>Worksheet Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: #FFFFFF;border-collapse: collapse; border-color: #BBB"><thead><tr style=" background-color: #DAE7F5;color: #161120"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: #DAE7F5;color: #161120">G2</th><td style="text-align:left">=LOOKUP(<font color="Blue">E2,A3:A7,INDEX(<font color="Red">B3:C7,0,MATCH(<font color="Green">F2,B2:C2,FALSE</font>)</font>)</font>)</td></tr></tbody></table></td></tr></table><br />
 

Mike Szczesny

Active Member
Joined
Feb 7, 2008
Messages
411
Here is a suggestion. Use the index with the match functions together.
=index(B3:C7,match(E2,A3:A7,1),match(F2,B2:C2,False)). Using 1 for the match type will look for 120 (cell A6), but will look for the next lower number 110 (cell A5). This will select the value in B5.
 

Watch MrExcel Video

Forum statistics

Threads
1,109,364
Messages
5,528,265
Members
409,811
Latest member
pjwhyman

This Week's Hot Topics

  • Change military grades into rank
    Afternoon all Need help with formula that will change military rank (i.e. 1, 2, 3 into Amn, A1C, SrA). Running IF formula that does not work...
  • VBA COUNTIF SOLUTION
    Hi The following are the errors spread across the several columns from E to Q ie. 13 columns across several sheets with more than 500 rows per...
  • INSERT ROW WITH SPECIFIS TEXT IN A COLUMN
    Hi All! How can identify that that the row to be inserted has to be inserted before 1st row with specific text in column F. If I record the...
  • Auto-Create a monthly Sign in sheet for preschool students
    The image below is what each page looks like. Above is space for the "Child Name" "Month" "Class" School days are obviously Monday-Friday but...
  • VBA vlookup multiple results
    Hi folks, Hopefully someone out there can help. I have a list to vlookup which works (ish). the lookup only picks up the first instance of the...
  • Extract values for earliest/latest times
    I am trying to put together a formula to get the earliest start time, the latest end time from column A for each person in Column B-F without the...
Top