Help with Formula & Filters

meggall

New Member
Joined
Jun 18, 2019
Messages
2
Hey!

Wondering if I can get help. I'm using the below formula in a spreadsheet. I'm looking for it to update based on if I filter other parts of the table which would hide some of the rows between 2:999. Does anyone know how I can update my formula to ignore hidden rows?

=SUM((COUNTIF(W2:W999,"P")*$W1001)+(COUNTIF(W2:W999,"F")*$W$1002))

Thanks in advance!
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
COUNTIF, unfortunately, cannot be used in the SUBTOTAL-type options.
There might be another simpler solution, but I did find one option.
It requires you to put all 1s in the X column, however.

Code:
=(W1001*SUMPRODUCT(SUBTOTAL(109,OFFSET(W2,ROW(W2:W999)-ROW(W2),1)),(W2:W999="P")+0))+$W1002*SUMPRODUCT(SUBTOTAL(109,OFFSET(W2,ROW(W2:W999)-ROW(W2),1)),(W2:W999="F")+0)

But I believe it'll work.
 
Upvote 0
Thanks for the response! :)

I gave it a shot but came up with 0 so I might need some more tweaking to get that one working. I managed to get it working enough for the functions I need to filter for at the moment by assigning data to column U and manipulating cell W1003 as my "Filter"

=SUM((COUNTIFS(W2:W999,"P",$U$2:$U$999,$W$1003)*$W1001)+(COUNTIFS(W2:W999,"F",$U$2:$U$999,$W$1003)*$W$1002))
 
Upvote 0

Forum statistics

Threads
1,223,980
Messages
6,175,763
Members
452,668
Latest member
mrider123

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