Want a sum of figures when 2 rows in different worksheets are a match

Nitaa

New Member
Joined
Sep 25, 2013
Messages
3
Hi, I have different worksheets in a workbook. I need one of the worksheets to sum up the figures from the other 2 worksheets when the row inputs in those worksheets are a match.

The input in one worksheet (eg row 1: Salary) may not be in the same row as worksheet 2. I tried using a if and or formula - it looked as it worked at one time but now I am not getting the results I want.

=IF(OR($A38='SG TECH BUDGET 2018'!$A32,'SGWWL Prdt IDP BUDGET 2018'!$A38='SG IDP BUDGET 2018'!$A32),SUM('SG TECH BUDGET 2018'!I32,'SG IDP BUDGET 2018'!I32))
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Care to post a small sample illustrative of your data along with the manually calculated desired result?
 
Upvote 0
Example - worksheet 1

in Col A row 12, I have code "54001" for 5000 under Jan column D and 6000 under Feb for Col E

Worksheet 2

col A row 25, I have the same code "54001" for 4000 under Jan Col D and 2500 under Feb for Col E

So I want in worksheet 3 to sum up 54001 in worksheet 1 & 2 under col D and E. Col D should sum 9000 and Col E 8500.
 
Upvote 0
Assuming the code "54001" only appears once on each spreadsheet the following will work:

I have assumed the heading of the code is called code. I have also assumed there is a heading on column D in your third worksheet that will exactly match the ones you wish to add up. e.g. they both say Jan, not one says Jan but one says January.

Code:
=ifna(index([COLOR=#333333]'SG TECH BUDGET 2018'[/COLOR]!$1:$1048576,match("code",[COLOR=#333333]'SG TECH BUDGET 2018'[/COLOR]!$1:$1,0),match(d$1,[COLOR=#333333]'SG TECH BUDGET 2018'[/COLOR]!$1:$1,0)),0)+ifna(index([COLOR=#333333]'SGWWL Prdt IDP BUDGET 2018'[/COLOR]!$1:$1048576,match("code",[COLOR=#333333]'SGWWL Prdt IDP BUDGET 2018'[/COLOR]!$1:$1,0),match(d$1,[COLOR=#333333]'SGWWL Prdt IDP BUDGET 2018'[/COLOR]!$1:$1,0)),0)

Depending on the version of excel you are using you may need to change IFNA to IFERROR.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,174
Messages
6,123,454
Members
449,100
Latest member
sktz

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