Multiply if

Giancar

Board Regular
Joined
Nov 29, 2017
Messages
52
Hi all,

I have tried to check for solutions but in vain. Hopefully someone can help :)

I have a 2 different sheet ("sheetA", "sheetB").

SheetA

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]ITALY[/TD]
[TD]100[/TD]
[/TR]
[TR]
[TD]FRANCE[/TD]
[TD]200[/TD]
[/TR]
[TR]
[TD]UK[/TD]
[TD]300[/TD]
[/TR]
[TR]
[TD]ITALY[/TD]
[TD]20[/TD]
[/TR]
[TR]
[TD]FRANCE[/TD]
[TD]30[/TD]
[/TR]
[TR]
[TD]UK[/TD]
[TD]60[/TD]
[/TR]
</tbody>[/TABLE]

SheetB
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]IRELAND[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]UK[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]ITALY[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]FRANCE[/TD]
[TD]8[/TD]
[/TR]
[TR]
[TD]NORWAY[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]BRAZIL[/TD]
[TD]2[/TD]
[/TR]
</tbody>[/TABLE]


Il cell C1 (SheetA), I would like to multiplying Columns B of SheetA and Column B of SheetB, if cell values in Column A are matching.

Result
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]ITALY[/TD]
[TD]100[/TD]
[TD]400[/TD]
[/TR]
[TR]
[TD]FRANCE[/TD]
[TD]200[/TD]
[TD]1600[/TD]
[/TR]
[TR]
[TD]UK[/TD]
[TD]300[/TD]
[TD]1500[/TD]
[/TR]
[TR]
[TD]ITALY[/TD]
[TD]20[/TD]
[TD]80[/TD]
[/TR]
[TR]
[TD]FRANCE[/TD]
[TD]30[/TD]
[TD]240[/TD]
[/TR]
[TR]
[TD]UK[/TD]
[TD]60[/TD]
[TD]300[/TD]
[/TR]
</tbody>[/TABLE]

Please consider that Column A of SheetA is very long, so I would need a formula that i drag quite easily.
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Hi,

Use SUMPRODUCT like so:


Book1
ABC
1ITALY100400
2FRANCE2001600
3UK3001500
4ITALY2080
5FRANCE30240
6UK60300
SheetA
Cell Formulas
RangeFormula
C1=SUMPRODUCT((SheetB!A$1:A$5000=A1)*(SheetB!B$1:B$5000)*B1)



Book1
AB
1IRELAND2
2UK5
3ITALY4
4FRANCE8
5NORWAY3
6BRAZIL2
SheetB


SheetA C1 formula copied down as far as needed, I used range to row 5000, change to higher if needed.
 
Upvote 0
Just another option...

Excel Workbook
ABC
1ITALY100400
2FRANCE2001600
3UK3001500
4ITALY2080
5FRANCE30240
6UK60300
sheetA
 
Upvote 0
Another option VLOOKUP.

Excel Workbook
ABC
1ITALY100400
2FRANCE2001600
3UK3001500
4ITALY2080
5FRANCE30240
6UK60300
Sheet A
Excel Workbook
AB
1IRELAND2
2UK5
3ITALY4
4FRANCE8
5NORWAY3
6BRAZIL2
Sheet B
 
Upvote 0
Thank you all. All the formulas suggested were working.
At the end I chose to use VLOOKUP formula.
 
Upvote 0

Forum statistics

Threads
1,223,907
Messages
6,175,300
Members
452,633
Latest member
DougMo

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