making a sumif within a filtered subtotal

Chenboy2

New Member
Joined
Sep 25, 2005
Messages
30
I'm recording income and expenses in a spreadsheet and I filter the not all of the transactions always appear. I have a subtotal that I want to display what the filtered income and expenses are. Right now I can only do a sumif for the total amounts, and not when the amounts are filtered. Is it possible to create a formula that will sumif the filtered income and expenses?
 

Some videos you may like

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

Tom Urtis

MrExcel MVP
Joined
Feb 10, 2002
Messages
11,224
You can use the SUBTOTAL function with the 9 (SUM) argument for a filtered list. Here's an example, with other common numeric arguments.

Slide069.png
 

Chenboy2

New Member
Joined
Sep 25, 2005
Messages
30
Thanks, I understand this but this is what I'm trying to do:

My spreadsheet has income and expenses, so both positive and negative numbers. I want to filter a certain group of transactions and I want the sun a sumif function of subtotal and not the entire transactions.

Example
Total transactions: 1000, 500, -200, -100, -50, 300, 385, 600, -750, -200
Filtered transactions: 500, -200, -100, 300, 385
I want the sumif to calcualte the income amoutn of 1185, and expense of -300

How do i create a function that I can do this for any filter I run?
 

Tom Urtis

MrExcel MVP
Joined
Feb 10, 2002
Messages
11,224
To sum just positive numbers and just negative numbers separately at the same time, assuming your numbers are in column B, from B2:B100, try these two formulas for a filtered list...

Positive only:
=SUMPRODUCT((B2:B100>0)+0,SUBTOTAL(9,OFFSET(B2:B100,ROW(B2:B100)-ROW(B2),0,1)))

Negative only:
=SUMPRODUCT((B2:B100<0)+0,SUBTOTAL(9,OFFSET(B2:B100,ROW(B2:B100)-ROW(B2),0,1)))
 
Last edited:

Watch MrExcel Video

Forum statistics

Threads
1,122,469
Messages
5,596,312
Members
414,052
Latest member
Dual Showman

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
Top