SUM based on same value across multiple columns

creative999

Board Regular
Joined
Jul 7, 2021
Messages
108
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
  2. MacOS
Hi

I have a formula SUMIF formula which works but now need to update it so part of the formula looks for the same value across two columns.

The formula needs to look at column B OR column D for Z1 value.

=SUM(SUMIFS(SHEET1!$A$2:$A$200,SHEET1!$B$2:$B$200,Z1, SHEET1!$C$2:$C$200,"9999"))
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Try a SUPRODUCT array formula. If in 2019 you may need to enter the formula with the CNTL-SHFT-ENTR keystroke combination
I took the sheet references out, you don't need them if you are on the same worksheet.
Excel Formula:
=SUMPRODUCT($A$2:$A$200 *
(($B$2:$B$200=Z1)+($D$2:$D$200=Z1))
*(($C$2:$C$200)="9999"))
..
 
Upvote 0
Try a SUPRODUCT array formula. If in 2019 you may need to enter the formula with the CNTL-SHFT-ENTR keystroke combination
I took the sheet references out, you don't need them if you are on the same worksheet.
Excel Formula:
=SUMPRODUCT($A$2:$A$200 *
(($B$2:$B$200=Z1)+($D$2:$D$200=Z1))
*(($C$2:$C$200)="9999"))
..

Thank you...
Tried the formula where C doesnt contain 9999 but getting a £0 value.
I also need to add some additional conditions... ie, E="ABC", F greater or equal to "100"
 
Upvote 0
Thank you...
Tried the formula where C doesnt contain 9999 but getting a £0 value.
I also need to add some additional conditions... ie, E="ABC", F greater or equal to "100"
Would be be kind enough to post some data, so I can build a formula with a worksheet instead of guessing what your data looks like?
an expected result or two would be helpful.

the xl2bb add in is the best way to post a mini sheet (it will post formulas and the calculations), if you cannot use that then please post a table which can be copied by the forum (images are not copyable, and mean the forum must recreate the scenario in total)

And you should get a zero value if there is no "9999", that is what is calculated when C2:C200 = "9999" will give you on row 50, if C50 is not equal to "9999".
In SUMPRODUCT array formulas, asterisks are "ANDS" and pluses are "ORS".
just curious, is column C really text?
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,910
Messages
6,175,318
Members
452,634
Latest member
cpostell

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