COUNTIF not working

ollyhughes1982

Well-known Member
Joined
Nov 27, 2018
Messages
793
Office Version
  1. 365
Platform
  1. MacOS
Hi, I wonder if anyone might be able to help, please.

I have a list of parkruns (and lots of other relevant details about each run) that I have completed, in the ‘All Completed Runs’ worksheet. This spreadsheet is populated from the data that is manually entered into the ‘ALL COMPLETED RUNS ENTRY’ worksheet.

In the ‘All Completed Runs - Summary’ worksheet I have a summary about these runs.

I am trying to count the Assisted Runs in the yellow highlighted field (‘# of Assisted parkruns’ [B56]) of the ‘All Completed Runs - Summary’ worksheet. The Assisted runs are signified by a 1 (conditionally highlighted in pink) in the relevant row of the S column in the ‘All Completed Runs’ worksheet. If there are no 1s in the column, then I want the yellow highlighted cell (B56) to appear empty.

I have tried the following formula:

=IF(COUNTIF('All Completed Runs'!S3:S2002,"?*")=0,"",COUNTIF('All Completed Runs'!S3:S2002,"?*"))

However this doesn’t seem to work, it only seems to work for counting if there are letters/text in the S column, rather than if there’s a 1.

I have 2 assisted runs in there, so the result should be 2. If I was to take out these two entries (i.e. remove them from the ‘ALL COMPLETED RUNS ENTRY’ worksheet), I would want the cell to appear empty, rather than showing a 0.

Apologies for the file size (it will take around 40 seconds to open), but there are lots of links and I can’t really cut the file down, because of the interconnectivity of worksheets. My file can be found here:

My parkrun Record.xlsx

Thanks.
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Maybe
Excel Formula:
=IFERROR(1/(1/COUNTIF('All Completed Runs'!S3:S2002,"1")),"")
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0
Sorry, just one more thing. In the cell next to it (C56), I have an alternate display with an 'x' in front of the number. If I want to add this in, how would I do that please? So the result would display 'x2', rather than just '2'. Again, appear blank if there are none. Thanks again.
 
Upvote 0
You'd have to use your formula but change the ?* to 1
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,322
Members
452,635
Latest member
laura12345

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