COUNTIF not working

ollyhughes1982

Well-known Member
Joined
Nov 27, 2018
Messages
677
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

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
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,214,911
Messages
6,122,198
Members
449,072
Latest member
DW Draft

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