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

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.

seroberts242

New Member
Joined
Mar 9, 2012
Messages
10
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

XOR LX

Well-known Member
Joined
Jul 2, 2012
Messages
4,517
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,195,663
Messages
6,011,013
Members
441,579
Latest member
satishrazdhan

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
Top