sumif only filtered area

HSOLDO

Board Regular
Joined
Sep 3, 2007
Messages
125
Hi,

i need to add only filtered area if criteria is met....

I am adding quantity of sales by salesperson.

B2 is salesperson name
H2 is the total quantity sold in filtered area. This is the cell i need calculated.

C13 to C1000 is salesperson name
D13 to D1000 is quantity sold for each sale.
E13 to E1000 is date

If i filter E13 to lets say March, I need H2 to show me total sum of sales A person in B2 made in filtered period.

Thx
 
Last edited:

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Try this

=SUMPRODUCT(SUBTOTAL(109,OFFSET($D$4,ROW($D$4:$D$1000)-ROW($D$4),,1))*($C$4:$C$1000=$B$2))
 
Upvote 0
Use the SUBTOTAL function:

Code:
=SUBTOTAL(109,D13:D1000)

This will sum all the values in that D column range that are visible after you apply your filter(s).
 
Last edited:
Upvote 0
Try this

=SUMPRODUCT(SUBTOTAL(109,OFFSET($D$4,ROW($D$4:$D$1000)-ROW($D$4),,1))*($C$4:$C$1000=$B$2))

Thanks! This works for me too! I've been trying to do a subtotal with conditions and this works! I am wondering if you wouldn't mind explaining it though. I'm not sure what the OFFSET or anything really after the SUBTOTAL(109, portion of your formula does. Really appreciate it. I like to learn and understand so I can apply it to other worksheets.
 
Upvote 0
What it does offset, is to take the values ​​of D4 down, but only of the rows that are visible. (it is an internal process that performs excel, the values ​​in hidden cells return them as 0)
That way it only adds the "visible" data.

*($C$4:$C$1000=$B$2)
This means that C is equal to the content of B2
 
Upvote 0
What it does offset, is to take the values ​​of D4 down, but only of the rows that are visible. (it is an internal process that performs excel, the values ​​in hidden cells return them as 0)
That way it only adds the "visible" data.

*($C$4:$C$1000=$B$2)
This means that C is equal to the content of B2

Awesome!!! Thanks. Love learning new tricks.
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,685
Members
448,978
Latest member
rrauni

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