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

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
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,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

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