Multiply 2 columns based on condition then sum them up

goodguy

New Member
Joined
Jul 20, 2016
Messages
9
ABCDEF
1ChocolateEUR8BRL/CAD3.1430
2Coffee beanBRL5EUR/CAD0.6760
3AppleUSD3USD/CAD0.7560
4MacaroonEUR10
5CandyUSD2
6TotalCAD

<tbody>
</tbody>

I have two tables as shown above.

I want to find the total in CAD according to their local currencies, i.e., C1/F2 + C2/F1 + C3/F3 + C4/F2 + C5/F3

I tried vlookup and index match embedded in sumproduct and sumifs but with no luck

It seems that I'll have to look up in column E with B1*, B2*, B3*, etc.

Can anyone please help? Thanks.
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
if you could add in a separate column for CAD this might help


Book1
ABCDEF
1ChocolateEUR811.83432BRL/CAD3.143
2Coffee beanBRL51.590837EUR/CAD0.676
3AppleUSD33.968254USD/CAD0.756
4MacaroonEUR1014.7929
5CandyUSD22.645503
6TotalCAD34.83181
Sheet22
Cell Formulas
RangeFormula
D1=C1/VLOOKUP(B1&"*",$E$1:$F$3,2,FALSE)
D2=C2/VLOOKUP(B2&"*",$E$1:$F$3,2,FALSE)
D3=C3/VLOOKUP(B3&"*",$E$1:$F$3,2,FALSE)
D4=C4/VLOOKUP(B4&"*",$E$1:$F$3,2,FALSE)
D5=C5/VLOOKUP(B5&"*",$E$1:$F$3,2,FALSE)
D6=SUM(D1:D5)


i cant figure out how to do it without adding a helper column of extra data and just putting it all in one formula in C6 though

sorry if that didnt help
 
Upvote 0
if you could add in a separate column for CAD this might help

ABCDEF
1ChocolateEUR811.83432BRL/CAD3.143
2Coffee beanBRL51.590837EUR/CAD0.676
3AppleUSD33.968254USD/CAD0.756
4MacaroonEUR1014.7929
5CandyUSD22.645503
6TotalCAD34.83181

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet22

Worksheet Formulas
CellFormula
D1=C1/VLOOKUP(B1&"*",$E$1:$F$3,2,FALSE)
D2=C2/VLOOKUP(B2&"*",$E$1:$F$3,2,FALSE)
D3=C3/VLOOKUP(B3&"*",$E$1:$F$3,2,FALSE)
D4=C4/VLOOKUP(B4&"*",$E$1:$F$3,2,FALSE)
D5=C5/VLOOKUP(B5&"*",$E$1:$F$3,2,FALSE)
D6=SUM(D1:D5)

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>



i cant figure out how to do it without adding a helper column of extra data and just putting it all in one formula in C6 though

sorry if that didnt help


Thanks fhqwgads. Yes, I tried to avoid creating extra columns/rows because this is just a simple version of my whole file. But thanks for your help anyway!
 
Upvote 0

Forum statistics

Threads
1,214,929
Messages
6,122,315
Members
449,081
Latest member
tanurai

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