Re: Countif- Visible Cells in Filter mode

willow1985

Well-known Member
Joined
Jul 24, 2019
Messages
871
Office Version
  1. 365
Platform
  1. Windows
Re: Countif- Visible Cells in Filter mode

Hello, I hope someone could help me with a formula I have.

I am looking to count any cells that contain "IAR" in range: A4:A10000

My current formula is: =COUNTIF(A4:A1000,"*IAR*")

This counts everything from A4 down that contains "IAR", however when a filter is applied I need it to count only the visible cells.

I have tried: =SUMPRODUCT(SUBTOTAL(3,OFFSET(A4:A1000,ROW(A4:A1000)-MIN(ROW(A4:A1000)),,1))*(A4:A1000="*IAR*")) and it gives a result as 0 instead of 219

Thank you to anyone who can help!!

Carla
 
Last edited:

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Re: Countif- Visible Cells in Filter mode

I figured it out.

New formula: =SUMPRODUCT(SUBTOTAL(3,OFFSET(A4:A10000,ROW(A4:A10000)-MIN(ROW(A4:A10000)),,1)),ISNUMBER(SEARCH("*IAR*",A4:A10000))+0)

This is working just fine. Not sure why the other never worked for me though...
 
Upvote 0

Forum statistics

Threads
1,213,506
Messages
6,114,024
Members
448,543
Latest member
MartinLarkin

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