Summing filtered columns by certain criteria

the man

New Member
Joined
Apr 9, 2019
Messages
3
Hi there,

I'm having an issue of finding a way to sum certain "profits" based on a variable/ criteria while filtered. I tried using Sumif function, but when data gets filtered it still sums the "hidden" data. is there a way to create a formula that changes the sum value when filtered.
ynCcwIA
for example- in the image attached- I'm trying to determine the sum of all "profit" values when I have filtered for abc and cba excluding bca
ynCcwIA.jpg
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
SUBTOTAL will sum Filtered data.
Hidden rows will still be included.
Yes, there is a fine difference between filtering and hiding rows.
 
Upvote 0
However, subtotals won't allow me to sum only abc data, if i slect abc and cba it will show the subtotal for both, disregarding that I only want to see the sum of ABC while filtering this way
 
Upvote 0
If you use
=SUBTOTAL(109,your range)
It will ignore both filtered & hidden rows
 
Upvote 0
Thanks this seems to work, now I just have to wrap my small brain around how to implement it in a larger scale

You are welcome. Note that you can have a condition like abc in a cell of its own and refer to that cell in the formula instead.

Let's insert a few rows in front of current row 1.

Let A1 house the abc value.

In B1 then you can have:

=SUMPRODUCT(SUBTOTAL(9,OFFSET($B$8,ROW($B$8:$B$19)-ROW($B$8),0)),($A$8:$A$19=$A1)+0)
 
Upvote 0
On a Large Scale (or even a small one) using Pivot Tables is far simpler and quicker way of getting these answers and having product/item comparisons side-by-side.
 
Upvote 0
If I use Index and Match function in place of Offset it is returning value error.

How to determine when to use offset function and when to use Index and Match.

Info: I have this confusion because both functions return cell references.
 
Upvote 0
If I use Index and Match function in place of Offset it is returning value error.

How to determine when to use offset function and when to use Index and Match.

Info: I have this confusion because both functions return cell references.

The subpart of the formula with OFFSET, that is,

OFFSET($B$8,ROW($B$8:$B$19)-ROW($B$8),0)

returns as desired a set of values (in fact, a set of subranges), not a single value. INDEX (with MATCH) would instead just deliver a single value.

Select this part of formula on the formula bar and apply F9 in order to see what this bits computes.
 
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,176
Members
451,543
Latest member
cesymcox

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