Avoiding Nesting Multiple Vlookups / One Value against changing Array

kevt97

New Member
Joined
Jan 5, 2007
Messages
7
Excel 2010

I have this problem I cannot figure out. I generally use Vlookups.

My lookup value is in cell A4, this equals $1538.00.

I want to check a dataset for this value.

The dataset =

col1
$1,538.46 $1,538.00 $1,538.47 $1,538.45 $39,999.96

Basically the value of A4 can vary up to x variations - this is in my table.

what I need:

I want to check A4 against col1, then col 2, then col 3 etc. and return col 5 when any of these cols match. if not, then 0.
 
Re-reading the thread, this isn't much different to nested VLOOKUPs that you wanted to avoid. :)
In fact, the VLOOKUP is shorter in length. :)

=IFERROR(INDEX(H2:H5,IFERROR(MATCH(A4,D2:D5,0),IFERROR(MATCH(A4,E2:E5,0),IFERROR(MATCH(A4,F2:F5,0),IFERROR(MATCH(A4,G2:G5,0),-1))))),0)
=IFERROR(VLOOKUP(A4,D2:H5,5),IFERROR(VLOOKUP(A4,E2:H5,4),IFERROR(VLOOKUP(A4,F2:H5,3),IFERROR(VLOOKUP(A4,G2:H5,2),0))))
 
Upvote 0

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
If your data is in D1:I4 and 1538.00 is in A4, the CSE formula
=MIN(IF($D$1:$I$4=A4,$H$1:$H$4))

should return those values.
It needs to be entered with Ctrl-Shift-Enter (Cmd+Return for Mac)
 
Upvote 0
Since you are using Excel 2010, here is another option.
It avoids nesting and would be easily scalable to more columns (and is shorter).

Excel Workbook
ABCDEFGH
21,538.461,538.001,538.471,538.4539,999.96
31,538.461,538.001,538.471,538.4539,999.96
41,653.8643,000.101,653.851,654.001,653.861,653.8443,000.10
51,711.541,712.001,711.551,711.5344,500.04
Lookup
 
Upvote 0
If your data is in D1:I4 and 1538.00 is in A4, the CSE formula
=MIN(IF($D$1:$I$4=A4,$H$1:$H$4))

should return those values.
It needs to be entered with Ctrl-Shift-Enter (Cmd+Return for Mac)
Very concise Mike & it may well be what the OP wants. If so, I had the wrong interpretation as I thought the search for the A4 value needed to be in columns from left to right. So for the data below, I thoght the value would need to be 41,000. Have to wait for OP feedback I guess.

Excel Workbook
ABCDEFGHI
21,538.461,538.001,538.471,538.4541,000.002,014.00
31,538.461,538.471,538.001,538.4539,999.962,013.00
41,538.0041,000.001,653.851,654.001,653.861,653.8443,000.102,012.00
539,999.961,711.541,712.001,711.551,711.5344,500.042,011.00
Lookup
 
Upvote 0
The formula that I gave will given the mimimum matching value.

To get the first row that matches, this CSE would work

=INDEX(resultColumn, MIN(IF(dataRange=A4, ROW(dataRange))))
 
Upvote 0

Forum statistics

Threads
1,215,568
Messages
6,125,599
Members
449,238
Latest member
wcbyers

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