Index Match Functions with Ranged quantity lookups

JMBurns578

New Member
Joined
Jun 22, 2016
Messages
5
I know how to do index match and I know how to do vlookups to find a value within a quantity range. I cannot seem to get it to work doing an index match function pulling a value from a table within a range. See attached image.

I want to be able to type a quantity, any number 1-1000, into the qty cell M5 and have the price per unit pulled from the table on the left show up in cell N5.
 

Attachments

  • Capture.PNG
    Capture.PNG
    44 KB · Views: 9

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
How about this.

Book1
ABCDEFGHIJKLMN
1
21101251501
3Part NumberSupplierYear1002505001000
4123Bob's202050484543Part NumberSupplierYearQtyPrice/Unit
5123Bob's202151494644123Bob's202115051
6123Bob's202252504745
7456Bob's20202000198119261885
8456Bob's20212030201019541913
9456Bob's20222060204019841941
10789Bob's2020526522518500
11789Bob's2021533529525507
12789Bob's2022541537533515
13123Steve's202047454240
14123Steve's202147464641
15123Steve's202248474442
16456Steve's20201800178217331696
17456Steve's20211827180917591721
18456Steve's20221854183617851747
19789Steve's2020573568564545
20789Steve's2021581577573553
21789Steve's2022590586581561
Sheet1
Cell Formulas
RangeFormula
N5N5{=INDEX($D$4:$G$21,MATCH(J5&K5&L5,$A$4:$A$21&$B$4:$B$21&$C$4:$C$21,0),LOOKUP(M5,$D$3:$G$3,COLUMN($D$2:$G$2)-3))}
Press CTRL+SHIFT+ENTER to enter array formulas surrounded with curly braces.
 
Upvote 0
Thanks so much! That is working for most of it. For some reason when I change the qty to one of the values in the bottom range (1-100) I keep getting an #N/A. It works for exactly 100, but 1-99 it is #N/A.

Any thoughts on what is causing that?
 
Upvote 0
Maybe
=INDEX(D4:G21,MATCH(J5&"|"&K5&"|"&L5,INDEX(A4:A21&"|"&B4:B21&"|"&C4:C21,0)),MATCH(M5,D2:G2,1))
 
Upvote 0
Another way:
=SUMPRODUCT((A4:A21=J5)*(B4:B21=K5)*(C4:C21=L5)*INDEX(D4:G21,,MATCH(M5,D2:G2,1)))
 
Upvote 0
Thanks a ton!
That worked for my example excel. Now I just need to get it work for my actual data. Any ideas on why when I transfer the formula to a different excel and realign all the lookup cells I keep getting either #N/A or #REF or it pulls the wrong value?
 
Upvote 0
Depends on which formula you are referring to, how you changed it, where the data is & where the formula is.
 
Upvote 0
Hi @JMBurns578, welcome to the board!

The formula works with the following structure (Taking the examples captured by lrobbo314).
If the structure of your data is different you can put a sample here to adapt your formula.
Use the XL2BB tool.

Upload an excel range:
XL2BB - Excel Range to BBCode

Book1
ABCDEFGHIJKLMN
1
21101251501
3Part NumberSupplierYear1002505001000
4123Bob's202050484543Part NumberSupplierYearQtyPrice/Unit
5123Bob's202151494644123Bob's202175044
6123Bob's202252504745
7456Bob's20202000198119261885
8456Bob's20212030201019541913
9456Bob's20222060204019841941
10789Bob's2020526522518500
11789Bob's2021533529525507
12789Bob's2022541537533515
13123Steve's202047454240
14123Steve's202147464641
15123Steve's202248474442
16456Steve's20201800178217331696
17456Steve's20211827180917591721
18456Steve's20221854183617851747
19789Steve's2020573568564545
20789Steve's2021581577573553
21789Steve's2022590586581561
Sheet
Cell Formulas
RangeFormula
N5N5=SUMPRODUCT((A4:A21=J5)*(B4:B21=K5)*(C4:C21=L5)*INDEX(D4:G21,,MATCH(M5,D2:G2,1)))
 
Upvote 0
Thanks y'all!! I greatly appreciate the help. I got it working for the most part. My actual table has about 1,000 line in it. For some reason I can get the formulas to work for one section, about 250 lines, but then when I open it up to the full table of 1,000 lines errors start popping up. I imagine it has to do with my data.

Thanks again, this will help me out a ton!
 
Upvote 0
Glad we could help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,214,622
Messages
6,120,572
Members
448,972
Latest member
Shantanu2024

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