Sumifs with a range of columns to sum

drluke

Active Member
Joined
Apr 17, 2014
Messages
314
Office Version
  1. 365
Platform
  1. Windows
[TABLE="width: 480"]
<tbody>[TR]
[TD="width: 64, bgcolor: transparent"][/TD]
[TD="width: 64, bgcolor: transparent"]A
[/TD]
[TD="width: 64, bgcolor: transparent"]B
[/TD]
[TD="width: 64, bgcolor: transparent"]C
[/TD]
[TD="width: 64, bgcolor: transparent"]D
[/TD]
[TD="width: 64, bgcolor: transparent"]E
[/TD]
[TD="width: 64, bgcolor: transparent"]F
[/TD]
[TD="width: 64, bgcolor: transparent"]G
[/TD]
[TD="width: 64, bgcolor: transparent"]H
[/TD]
[TD="width: 64, bgcolor: transparent"]I
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]1
[/TD]
[TD="bgcolor: transparent"]SumClient
[/TD]
[TD="bgcolor: transparent"]Yr
[/TD]
[TD="bgcolor: transparent"]Period
[/TD]
[TD="bgcolor: transparent"]Invoice Date
[/TD]
[TD="bgcolor: transparent"]Item Code
[/TD]
[TD="bgcolor: transparent"]Cost
[/TD]
[TD="bgcolor: transparent"]Disc
[/TD]
[TD="bgcolor: transparent"]Adj
[/TD]
[TD="bgcolor: transparent"]BALANCE
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]2
[/TD]
[TD="bgcolor: transparent"]A569
[/TD]
[TD="bgcolor: transparent, align: right"]2018
[/TD]
[TD="bgcolor: transparent, align: right"]1
[/TD]
[TD="bgcolor: transparent"]12/01/2018
[/TD]
[TD="bgcolor: transparent"]MEDIA
[/TD]
[TD="bgcolor: transparent"]100.00
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]212.14
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]3
[/TD]
[TD="bgcolor: transparent"]A569
[/TD]
[TD="bgcolor: transparent, align: right"]2018
[/TD]
[TD="bgcolor: transparent, align: right"]1
[/TD]
[TD="bgcolor: transparent"]12/01/2018
[/TD]
[TD="bgcolor: transparent"]MEDIA
[/TD]
[TD="bgcolor: transparent"]56.25
[/TD]
[TD="bgcolor: transparent, align: right"](3.25)
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]4
[/TD]
[TD="bgcolor: transparent"]A569
[/TD]
[TD="bgcolor: transparent, align: right"]2018
[/TD]
[TD="bgcolor: transparent, align: right"]1
[/TD]
[TD="bgcolor: transparent"]18/01/2018
[/TD]
[TD="bgcolor: transparent"]MEDIA
[/TD]
[TD="bgcolor: transparent"]56.25
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]2.89
[/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]5
[/TD]
[TD="bgcolor: transparent"]SE152
[/TD]
[TD="bgcolor: transparent, align: right"]2018
[/TD]
[TD="bgcolor: transparent, align: right"]1
[/TD]
[TD="bgcolor: transparent"]04/01/2018
[/TD]
[TD="bgcolor: transparent"]MEDIA
[/TD]
[TD="bgcolor: transparent"]1,071.20
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent, align: right"](4,619.55)
[/TD]
[TD="bgcolor: transparent"]-
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]6
[/TD]
[TD="bgcolor: transparent"]SE152
[/TD]
[TD="bgcolor: transparent, align: right"]2018
[/TD]
[TD="bgcolor: transparent, align: right"]1
[/TD]
[TD="bgcolor: transparent"]12/01/2018
[/TD]
[TD="bgcolor: transparent"]MEDIA
[/TD]
[TD="bgcolor: transparent"]1,272.05
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]7
[/TD]
[TD="bgcolor: transparent"]SE152
[/TD]
[TD="bgcolor: transparent, align: right"]2018
[/TD]
[TD="bgcolor: transparent, align: right"]1
[/TD]
[TD="bgcolor: transparent"]25/01/2018
[/TD]
[TD="bgcolor: transparent"]MEDIA
[/TD]
[TD="bgcolor: transparent"]2,276.30
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent, colspan: 5"]How can I change the formula I have in I2, I5 etc to:
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent, colspan: 3"](a) sum columns F to H
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent, colspan: 5"](b) using A2 and C1 as criteria (like in sumifs)
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent, colspan: 6"]Currently I have this formula in I2, but it's not working:
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent, colspan: 7"]=IF(COUNTIFS($A$2:A2,A2,$C$2:C2,I2)=1,SUM(IF($A:$A=A2,$F:$H),""))

[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
</tbody>[/TABLE]
 
Last edited:

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Hi,

Is this what you mean:


Book1
ABCDEFGHI
1SumClientYrPeriodInvoice DateItem CodeCostDiscAdjBALANCE
2A569201811/12/2018MEDIA100212.14
3A569201811/12/2018MEDIA56.25-3.25
4A569201811/18/2018MEDIA56.252.89
5SE152201811/4/2018MEDIA1,071.20-4,619.550
6SE152201811/12/2018MEDIA1,272.05
7SE152201811/25/2018MEDIA2,276.30
Sheet256
Cell Formulas
RangeFormula
I2=IF(COUNTIFS(A$2:A2,A2,C$2:C2,C2)=1,SUMPRODUCT((A$2:A$7=A2)*(C$2:C$7=C2)*F$2:H$7),"")


Change/adjust cell references/range according to your data, formula copied down.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,182
Members
453,021
Latest member
Mohamed Magdi Tawfiq Emam

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