Counting filtered cells

ollyhughes1982

Well-known Member
Joined
Nov 27, 2018
Messages
677
Office Version
  1. 365
Platform
  1. MacOS
Hi,

Re my recent posts regarding my parkrun spreadsheet, I am wondering if anyone might be able to help, please. I want to count the cells in the source worksheet where I have completed that parkrun (i.e. has a date in the date field). before using the filter formula in the source worksheet, I used to manually input the list and the formula below used to work:

=IF('All Completed Runs'!B4="","",(COUNTIF('All Completed Runs - EM R (UK)'!B4:B2003,">0"))&" out of"&" "&COUNTIF('All Completed Runs - EM R (UK)'!B4:B2003,"<>"))

What would I now need to change this to? It's actually correct that I haven't done any out of that region, but it should read 0 out of 44, rather than 2000.

File link is here: parkrun Chess Example.xlsx

It may take a minute or so to open, due to the size.

Thanks again.
Screenshot 2021-10-14 at 15.01.07.jpg
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
File can't be opened, too big for excel online and no option to download for desktop.

I think that this is correct but have not been able to test it.
Excel Formula:
=IF('All Completed Runs'!B4="","",SUM(SUBTOTAL(2,Offset('All Completed Runs - EM R (UK)'!B4,ROW(All Completed Runs - EM R (UK)'!B4:B2003)-ROW(All Completed Runs - EM R (UK)'!B4),0,1,1))*(All Completed Runs - EM R (UK)'!B4:B2003>0))&" out of"&" "&SUM(SUBTOTAL(2,Offset('All Completed Runs - EM R (UK)'!B4,ROW(All Completed Runs - EM R (UK)'!B4:B2003)-ROW(All Completed Runs - EM R (UK)'!B4),0,1,1))))
 
Upvote 0
Another option is to simply change the 2nd countif to look at col A rather then B.
 
Upvote 0
From the screen capture I had assumed normal filter, but if what you say is true then subtotal is not going to work because nothing will be hidden.

If it is related to the filter formula question then surely COUNTIF(B2#,">0") and COUNT(B2#) where B2# refers to the spill range of the filter formula, should work in place of the current countifs functions?
 
Upvote 0
I think that the filter formula is in col A & is text with a date in col B, so the formula could be changed to
Excel Formula:
=IF('All Completed Runs'!B4="","",(COUNTIF('All Completed Runs - EM R (UK)'!B4:B2003,">0"))&" out of"&" "&ROWS('All Completed Runs - EM R (UK)'!A4#))
 
Upvote 0
Solution
I think that the filter formula is in col A & is text with a date in col B, so the formula could be changed to
Excel Formula:
=IF('All Completed Runs'!B4="","",(COUNTIF('All Completed Runs - EM R (UK)'!B4:B2003,">0"))&" out of"&" "&ROWS('All Completed Runs - EM R (UK)'!A4#))
This worked. Thanks again.
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,795
Messages
6,121,624
Members
449,041
Latest member
Postman24

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