Count filtered cells with exclusion

seroberts242

New Member
Joined
Mar 9, 2012
Messages
10
Hi,

I want to count filtered cells but I don't want the count to include cells that contain "x" or empty cells.

I use this formula to count filtered cells:
=SUBTOTAL(103,A2:A140)

I use this to count with the exception of cells that contain "x":
=COUNTIFS(A2:A140,"<>",A2:A140,"<>x")

I guess I'm trying to figure out how to get all of this into one formula..

Thanks in advance!
 

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.
Thanks for your reply; unfortunately this isn't working for me. Not sure what's happening but the returned counts don't make sense.

For example I have filters on and applied, there are a total of 23 rows after filtering.

Column Q has 3 cells with text and the rest are blank. The count returned is 8.

Another column, O, has 8 cells with text and the rest are filled with "x". The count returned here is 21.


Capture.PNG
 
Upvote 0
Hi.

=SUMPRODUCT(N(SUBTOTAL(3,OFFSET(A2,ROW(A2:A140)-MIN(ROW(A2:A140)),))),N(A2:A140<>""),N(A2:A140<>"x"))

Regards
 
Upvote 0

Forum statistics

Threads
1,213,532
Messages
6,114,177
Members
448,554
Latest member
Gleisner2

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