Sum If Is Not Summing Horizontally

Guzzlr

Well-known Member
Joined
Apr 20, 2009
Messages
982
Office Version
  1. 2021
Platform
  1. Windows
Code:
=SUMIF(B2:B4,B2,F2:J2)

Hello All, I ran into an issue using SUMIF. The formula above only pulls the number in F2. I want the SUMIF to sum horizontally, instead of vertically.
I thought it would sum horizontally?
thanks
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
2601011121314
31718192021
21302425262728
is this what you want as output ?

<colgroup><col width="64" span="12" style="width:48pt"> </colgroup><tbody>
</tbody>
 
Upvote 0
2601011121314
317
18
19
20
21
21302425262728
is this what you want as output ?

<tbody>
</tbody>

Not exactly, the criteria column would be something like 2,3,4. If the criteria was 2, it would be 60, if the criteria was 3 it would be 95.
There would be multiple criteria 2 down the single column of B:B, all adding Column F:N, based upon Criteria 2 every time the criteria 2 would be found in Column B:B.
Criteria 3 in Column B:B would add column F:N everywhere Criteria 3 was found in Column B:B
Thanks for the help
 
Upvote 0
SUMIF can sum horizontally, but your criteria range is vertical and your sum range is horizontal which is what is causing the problem.

Is this what you want?

=SUMPRODUCT((B2:B4=B2)*F2:J4)


Excel 2010
BCDEFGHIJ
221011121314
331718192021
422425262728
5
6
7190
Sheet1
Cell Formulas
RangeFormula
D7=SUMPRODUCT((B2:B4=B2)*F2:J4)
 
Last edited:
Upvote 0
Type12/271/31/101/171/241/312/72/14
BCWS633.9635.7750.3716.0710.92
BCWP49.9569.51568.31307.5898.43
ACWP232.5336.61502.01422.31000.80
BCWS635.2714.41874.01663.91245.52
BCWP188.7378.51686.01391.41615.24
ACWP157.5275.01314.31644.41488.80
BCWS472.2451.21301.91155.81157.61
BCWP67.2121.0828.7659.5760.44
ACWP78.998.7794.1725.5843.70
Type12/271/31/101/171/241/312/72/14
BCWS17411801392635363114000
BCWP3061069408333583274000
ACWP469710361037923333000

<colgroup><col style="width:48pt" width="64" span="9"> </colgroup><tbody>
</tbody>

This is what I'm building so I can make a chart based upon BCWS, BCWP, ACWP numbers. so the totals sum each of the 3 criteria.
Thanks
 
Upvote 0
Are those the values that you want?
As from that layout you seem to adding the values vertically not horizontally.
 
Upvote 0
TypeDec-2701-Mar01-OctJan-17Jan-24Jan-3102-JulFeb-14
BCWS633.9635.7750.3716710.92
BCWP49.9569.51568.31307.5898.43
ACWP232.5336.615021422.31000.8
BCWS635.2714.418741663.91245.52
BCWP188.7378.516861391.41615.24
ACWP157.52751314.31644.41488.8
BCWS472.2451.21301.91155.81157.61
BCWP67.2121828.7659.5760.44
ACWP78.998.7794.1725.5843.7
TypeDec-2701-Mar01-OctJan-17Jan-24Jan-3102-JulFeb-14
BCWS17411801392635363114000
BCWP3061069408333583274000
ACWP469710361037923333000
BCWS1741.31801.33926.23535.73114.05000
BCWP305.8106940833358.43274.11000
ACWP468.9710.33610.43792.23333.3000
my lower table uses this simple formula
in B20 to the right of BCWS
=SUMPRODUCT(($A$2:$A$10=$A20)*(B$2:B$10))
dragged across and down

<colgroup><col width="64" span="12" style="width:48pt"> </colgroup><tbody>
</tbody>
 
Upvote 0
Are those the values that you want?
As from that layout you seem to adding the values vertically not horizontally.

Correct, currently I'm having to add each criteria vertically, one column at at time. I was trying to add horizontally, and vertically. I havent tried the other suggestions yet...ill get to that later today I hope.
thanks for the help
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,399
Latest member
alchavar

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