Subtotal with IF formula

ryan7

Board Regular
Joined
Apr 30, 2020
Messages
84
Office Version
  1. 2016
Platform
  1. Windows
My formula is
Excel Formula:
=SUBTOTAL(9,T4:T3551)

I want to add another criteria so that it only calculates cells with a value greater than Zero,

Can someone please help?

Thanks
 
Last edited by a moderator:

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
hi,
How about using
Excel Formula:
SUMIFS
instead?
 
Upvote 0
=sumifs(sum_range,criteria_range1,criteria,....)

Book1
AB
1a1
2a2
3a3
4a0
5a-1
6b5
7b1
8b6
9b0
10a1
117
Sheet2
Cell Formulas
RangeFormula
B11B11=SUMIFS(B1:B10,A1:A10,"a",B1:B10,">"&0)


like this
 
Upvote 0
How about
Excel Formula:
=SUMPRODUCT(SUBTOTAL(109,OFFSET(T$4,ROW(T$4:T$3551)-ROW(T$4),0)),--($T$4:$T$3551>0))
 
Upvote 0
How about
Excel Formula:
=SUMPRODUCT(SUBTOTAL(109,OFFSET(T$4,ROW(T$4:T$3551)-ROW(T$4),0)),--($T$4:$T$3551>0))
This Worked, Thank you.
Seems overly complicated to me but worked a treat.
Thanks Again
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0
Hi,
If I wanted to also include a SUM that holds the total when filtering cells, what would this be?

Thanks
 
Upvote 0
That formula does return the sum.
 
Upvote 0
That formula does return the sum.
It returns a subtotal. So when i apply a filter to look at specific rows the figure changes.
I'd also like to add a sum that retains the value.

Many thanks.
 
Upvote 0

Forum statistics

Threads
1,215,219
Messages
6,123,688
Members
449,117
Latest member
Aaagu

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