vlookup function applied to the table containing equal values

AlexIV

New Member
Joined
Jan 18, 2018
Messages
7
Hello Everyone,

I need to generate an invoice (new table) extracting data from tables 1&2 below. The input values are: Product #, Quantity and Destination.
The ouput parameters are: price per kg , discount per kg, shipping per kg, total price.
I'm trying to use vlookup function but the challenge is the product column contains the same products.

Table 1. Product pricing
Product #SAP IDProduct Ship QtyPriceDiscountEx-works price USD/kg
1111000000A1<100kg$100.00$5.00$95
1111000000A1100 -500kg$80.00$5.00$75
1111000000A1>500 kg$70.00$5.00$65
1211000001B2<100kg$56$7.00$49
1211000001B2100 -500kg$54$7.00$47
1211000001B2>500 kg$51$7.00$44
Table 2 Shipping Cost
City Cost, $/kg
NYC5
Toronto3
Seatle4
Invoice
Product# Quantity Destination Price Shipping Total price
121 50 NYC 56.36 5 3058

<tbody>
</tbody>
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
i dont get where the 3058 gets calculated

1.product #, quantity (weight) and destination are entered in the invoice table
2. price is extracted from Table 1 and Shipping rate is extracted from Table2
3. Total price is calculated = weight x( price + shipping rate)
 
Upvote 0
Ok instead of <100 100-500 and > 500 can you put 0 100 500 in those cells? Ive pasted your tables into excel as they appear above then in cell D22:

=LOOKUP(2,1/(($A$3:$A$10=A22)*($D$3:$D$10<=B22)),$E$3:$E$10)

cell E22:

=VLOOKUP(C22,$A$14:$B$16,2,0)

and cell F22:

=SUM(D22:E22)*B22

Makes sure all your dollar amounts are true numbers not text.
 
Upvote 0
Ok instead of <100 100-500 and > 500 can you put 0 100 500 in those cells? Ive pasted your tables into excel as they appear above then in cell D22:

=LOOKUP(2,1/(($A$3:$A$10=A22)*($D$3:$D$10<=B22)),$E$3:$E$10)

cell E22:

=VLOOKUP(C22,$A$14:$B$16,2,0)

and cell F22:

=SUM(D22:E22)*B22

Makes sure all your dollar amounts are true numbers not text.

It does not work. I think there is an error in the formula =LOOKUP(2,1/(($A$3:$A$10=A22)*($D$3:$D$10<=B22)),$E$3:$E$10)
Is it supposed to be =LOOKUP(A22,1/(
 
Upvote 0

Forum statistics

Threads
1,214,893
Messages
6,122,118
Members
449,066
Latest member
Andyg666

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