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="width: 593"]
<tbody>[TR]
[TD="colspan: 3"]Table 1. Product pricing[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Product #[/TD]
[TD]SAP ID[/TD]
[TD]Product[/TD]
[TD] Ship Qty[/TD]
[TD]Price[/TD]
[TD]Discount[/TD]
[TD="colspan: 2"]Ex-works price USD/kg[/TD]
[/TR]
[TR]
[TD="align: right"]111[/TD]
[TD="align: right"]1000000[/TD]
[TD]A1[/TD]
[TD]<100kg[/TD]
[TD="align: right"]$100.00[/TD]
[TD="align: right"]$5.00[/TD]
[TD="align: right"]$95[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]111[/TD]
[TD="align: right"]1000000[/TD]
[TD]A1[/TD]
[TD]100 -500kg[/TD]
[TD="align: right"]$80.00[/TD]
[TD="align: right"]$5.00[/TD]
[TD="align: right"]$75[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]111[/TD]
[TD="align: right"]1000000[/TD]
[TD]A1[/TD]
[TD]>500 kg[/TD]
[TD="align: right"]$70.00[/TD]
[TD="align: right"]$5.00[/TD]
[TD="align: right"]$65[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]121[/TD]
[TD="align: right"]1000001[/TD]
[TD]B2[/TD]
[TD]<100kg[/TD]
[TD="align: right"]$56[/TD]
[TD="align: right"]$7.00[/TD]
[TD="align: right"]$49[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]121[/TD]
[TD="align: right"]1000001[/TD]
[TD]B2[/TD]
[TD]100 -500kg[/TD]
[TD="align: right"]$54[/TD]
[TD="align: right"]$7.00[/TD]
[TD="align: right"]$47[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]121[/TD]
[TD="align: right"]1000001[/TD]
[TD]B2[/TD]
[TD]>500 kg[/TD]
[TD="align: right"]$51[/TD]
[TD="align: right"]$7.00[/TD]
[TD="align: right"]$44[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 3"]Table 2 Shipping Cost[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]City[/TD]
[TD="colspan: 2"] Cost, $/kg[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]NYC[/TD]
[TD="align: right"]5[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Toronto[/TD]
[TD="align: right"]3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Seatle[/TD]
[TD="align: right"]4[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Invoice[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 6"]Product# Quantity Destination Price Shipping Total price[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 5"]121 50 NYC 56.36 5 3058[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
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="width: 593"]
<tbody>[TR]
[TD="colspan: 3"]Table 1. Product pricing[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Product #[/TD]
[TD]SAP ID[/TD]
[TD]Product[/TD]
[TD] Ship Qty[/TD]
[TD]Price[/TD]
[TD]Discount[/TD]
[TD="colspan: 2"]Ex-works price USD/kg[/TD]
[/TR]
[TR]
[TD="align: right"]111[/TD]
[TD="align: right"]1000000[/TD]
[TD]A1[/TD]
[TD]<100kg[/TD]
[TD="align: right"]$100.00[/TD]
[TD="align: right"]$5.00[/TD]
[TD="align: right"]$95[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]111[/TD]
[TD="align: right"]1000000[/TD]
[TD]A1[/TD]
[TD]100 -500kg[/TD]
[TD="align: right"]$80.00[/TD]
[TD="align: right"]$5.00[/TD]
[TD="align: right"]$75[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]111[/TD]
[TD="align: right"]1000000[/TD]
[TD]A1[/TD]
[TD]>500 kg[/TD]
[TD="align: right"]$70.00[/TD]
[TD="align: right"]$5.00[/TD]
[TD="align: right"]$65[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]121[/TD]
[TD="align: right"]1000001[/TD]
[TD]B2[/TD]
[TD]<100kg[/TD]
[TD="align: right"]$56[/TD]
[TD="align: right"]$7.00[/TD]
[TD="align: right"]$49[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]121[/TD]
[TD="align: right"]1000001[/TD]
[TD]B2[/TD]
[TD]100 -500kg[/TD]
[TD="align: right"]$54[/TD]
[TD="align: right"]$7.00[/TD]
[TD="align: right"]$47[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]121[/TD]
[TD="align: right"]1000001[/TD]
[TD]B2[/TD]
[TD]>500 kg[/TD]
[TD="align: right"]$51[/TD]
[TD="align: right"]$7.00[/TD]
[TD="align: right"]$44[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 3"]Table 2 Shipping Cost[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]City[/TD]
[TD="colspan: 2"] Cost, $/kg[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]NYC[/TD]
[TD="align: right"]5[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Toronto[/TD]
[TD="align: right"]3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Seatle[/TD]
[TD="align: right"]4[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Invoice[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 6"]Product# Quantity Destination Price Shipping Total price[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 5"]121 50 NYC 56.36 5 3058[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]