making a sumif within a filtered subtotal

Chenboy2

New Member
Joined
Sep 25, 2005
Messages
34
Office Version
  1. 365
Platform
  1. Windows
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?
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
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
 
Upvote 0
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?
 
Upvote 0
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:
Upvote 0

Forum statistics

Threads
1,214,581
Messages
6,120,368
Members
448,957
Latest member
BatCoder

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