Two-way lookup with INDEX and MATCH return closest match

mschelle6

New Member
Joined
Sep 28, 2009
Messages
6
I'm working on a spreadsheet and have run into a issue using Two-way lookup with INDEX and MATCH. If the value is not in the table, I need excel to use the next highest value. Below is the formula I'm using.

=INDEX('LarsonTable'!B4:K54,MATCH(Work!F20,'LarsonTable'!A4:A54,1),MATCH(Work!F16,'LarsonTable'!B3:K3,1))

This formula is not showing the next highest number

Frame
United Inches
7/8
25
Width of Molding in Inches
4.7

<colgroup><col style="width:48pt" width="64" span="4"> <col style="mso-width-source:userset;mso-width-alt:4022;width:83pt" width="110"> </colgroup><tbody>
</tbody>

Since 7/8 or 25 is not in the table, I need the formula to use 26 and 5.7, but current it's using 24 and 4.7

1/2"
1"
24 Feet
4.7
5.0
26 Feet
5.3
5.7

<tbody>
</tbody>

Thanks
 

James006

Well-known Member
Joined
Apr 4, 2009
Messages
3,680
Hello,

You could test following:

Code:
[COLOR=#333333]=INDEX('LarsonTable'!B4:K54,MATCH(Work!F20,'LarsonTable'!A4:A54)+1,MATCH(Work!F16,'LarsonTable'!B3:K3)+1)[/COLOR]
Hope this will help
 

mschelle6

New Member
Joined
Sep 28, 2009
Messages
6
This worked, but now it's adding an extra number when I have an exact match

Below is my criteria


Width
7/8
UI
25
Width of Molding
4.7

<tbody>
</tbody>


Table where information is pulled
UI
Width
1/2"
1"
20
4.0
4.3
22
4.3
4.7
24
4.7
5.0
26
5.0
5.3
28
5.3
5.7

<tbody>
</tbody>

In this example, I need to use the UI of 26 and the Width of 1", to get a Width of Molding of 5.3. My current formula is pulling the UI of 24 and the Width of 1/2" making me have a Width of Molding of 4.7.
If I have a UI of 28 and a width of 1/2", I need to use the exact value which will equal Width of Molding of 5.3

My current formula is
=INDEX('LarsonTable'!B4:K54,MATCH(Work!F20,'LarsonTable'!A4:A54,1),MATCH(Work!F16,'LarsonTable'!B3:K3,1))
 

Marcelo Branco

MrExcel MVP
Joined
Aug 23, 2010
Messages
16,317
My current formula is
=INDEX('LarsonTable'!B4:K54,MATCH(Work!F20,'LarsonTable'!A4:A54,1),MATCH(Work!F16,'LarsonTable'!B3:K3,1))
See if this works
=INDEX(LarsonTable!B4:K54,MATCH(Work!F20,LarsonTable!A4:A54,1)+1*ISNA(MATCH(Work!F20,LarsonTable!A4:A54,0)),MATCH(Work!F16,LarsonTable!B3:K3,1)+1*ISNA(MATCH(Work!F16,LarsonTable!B3:K3,0)))

M.
 
Last edited:

Forum statistics

Threads
1,081,862
Messages
5,361,740
Members
400,653
Latest member
ProParadox

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top