Quote Creation Document - Requiring double lookup

LyndseyK

New Member
Joined
Oct 17, 2019
Messages
2
Hi
Would anyone be able to help me?
I am trying to create a document that will auto populate from an excel sheet with product and pricing, sheet 1 is the quote template, with sheet 2 being the data behind.

Sheet 1 - Quote template
DEFGHIJK
12ProductDescQtyUnit Pricetotal
13Code0001Product x22£4

<tbody>
</tbody>

Sheet 2
ABCDEFGHIJKLM
2DescCODE124.0049.0099.00199.00299.00399.00499.00750.00999.001000.00
3Product xCode0001£1£2£3£4£5£6£7£8£9£10£11

<tbody>
</tbody>
I require cell J13 on Sheet 1, to look at cell D13 first, then correspond this to sheet 2 and the correct code and pricing.
I have got the second part of the formula, which looks at the correct band, and results in that price. But what I need now is that same cell to look at the D13 to see what that corresponds to in sheet 2 to product the correct row pricing?

<tbody>
</tbody>

=IF(I13=Sheet2!$C$2,Sheet2!C3,IF(I13<=Sheet2!$D$2,Sheet2!D3,IF(I13<=Sheet2!$E$2,Sheet2!E3,IF(I13<=Sheet2!$F$2,Sheet2!F3,IF(I13<=Sheet2!$G$2,Sheet2!G3,IF(I13<=Sheet2!$H$2,Sheet2!H3,IF(I13<=Sheet2!$I$2,Sheet2!I3,IF(I13<=Sheet2!$J$2,Sheet2!J3,IF(I13<=Sheet2!$K$2,Sheet2!K3,IF(I13<=Sheet2!$L$2,Sheet2!L3,IF(I13<=Sheet2!$M$2,Sheet2!M3)))))))))))

Thank you
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Hi & welcome to MrExcel.
How about for J13
=INDEX(Sheet2!$C$3:$M$13,MATCH(D13,Sheet2!$B$3:$B$13,0),AGGREGATE(15,6,(COLUMN(Sheet2!$C$2:$M$2)-COLUMN(Sheet2!$C$2)+1)/(Sheet2!$C$2:$M$2>=$I13),1))
 
Upvote 0
Thank you for coming back so quick, however, doesn't seem to work as returns a #n/a.
D2 to M2 on sheet 2 is the pricing band, ie, if you order 50 units of "product x", the price is £4, if you order 49 units it is £3.

So do I need to insert this after each IF formula, or remove the entire formula and just use yours?

The formula basically needs to look at Sheet 1 D13, if that code is Product X on sheet 1 and corresponds to product x on sheet 2, then find that product on sheet 2 and look at the corresponding row. Then also look at quantity in sheet 1 I13, if that is less than or equal to row d2(for example and continuing across as per my formula) then return the value in row D3 that corresponds to that product code.
I hope this makes sense, I know it is a little complex.

This needs to run down through 100s of product codes and pricing bands but once I get it sorted for one, I will manage that.
 
Upvote 0
Replace the formula you have in J13 with the one I suggested.


Book1
ABCDEFGHIJKLM
2DescCODE12449991992993994997509991000
3Product xCode0001£1£2£3£4£5£6£7£8£9£10£11
4Code0002£10£11£12£13£14£15£16£17£18£19£20
Sheet2



Book1
DEFGHIJK
12ProductDescQtyUnit Pricetotal
13Code0001Product x22£4
14Code00022411£264
Sheet1
Cell Formulas
RangeFormula
J13=INDEX(Sheet2!$C$3:$M$13,MATCH(D13,Sheet2!$B$3:$B$13,0),AGGREGATE(15,6,(COLUMN(Sheet2!$C$2:$M$2)-COLUMN(Sheet2!$C$2)+1)/(Sheet2!$C$2:$M$2>=$I13),1))
 
Upvote 0

Forum statistics

Threads
1,214,375
Messages
6,119,166
Members
448,870
Latest member
max_pedreira

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