Need more than COUNTIF function, I think..

sunstarer

New Member
Joined
Oct 16, 2020
Messages
14
Office Version
  1. 2013
Platform
  1. Windows
With some of your help I built a spreadsheet that tallies wins in a game, that populates a cell with a win count. Works great. See below.

=COUNTIF(A1:A10,"w")

I'd like to add more functionality since when no one wins the cells are blank.
My goal is to have the column report a '0' if there are no wins, rather than show a blank cell and this simple formula can only count 'w' and provide a total.
Suggestions anyone?

Thanks very much in advance.
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
So what do you actually want.....a formula that counts "w" AND 0 ??
 
Upvote 0
Maybe this
Excel Formula:
=IF(COUNTIF(A1:A10,"w")=0,COUNTIF(A1:A10,0),COUNTIF(A1:A10,"w"))
 
Upvote 0
Hi Sunstarer

Your post # 1 states: since when no one wins the cells are blank.
Your post # 3 states: I need to count 'w' and if there are none, then report '0'.

In said case your formula and the one provided by Micheal will give same results

If you need to count zeros then you will have to set your formula in range A1:A10 to return zero rather than a blank cell if there are no wins
 
Upvote 0
That looks good to my eye but does not work. Could be my fault. I did edit the cell names, nothing else. I do see a couple of red parentheses when I plug it in, don't those indicate a flaw? You can see how little I deal with excel. It's embarassing at times. Thank you for the assist very much. Let me play with this a bit more.
 
Upvote 0
@hrayani, when there are no wins (w's), the cell is left blank. I'd like to check for blanks and calculate them too, besides count w's.
 
Upvote 0
@hrayani, when there are no wins (w's), the cell is left blank. I'd like to check for blanks and calculate them too, besides count w's.

Just a little change in Micheal's formula

Excel Formula:
=IF(COUNTIF(A1:A10,"w")=0,COUNTIF(A1:A10,""),COUNTIF(A1:A10,"w"))
 
Upvote 0
Just a little change in Micheal's formula

Excel Formula:
=IF(COUNTIF(A1:A10,"w")=0,COUNTIF(A1:A10,""),COUNTIF(A1:A10,"w"))


I've modified it to be more specific to the cells in question and I get a strange result. It reports a large number of blanks rather than a '0'.

Here's my change, as you can see it only reference a different range of cells that my simple example I posted.

=IF(COUNTIF(B3:AC3,"w")=0,COUNTIF(B3:AC3,""),COUNTIF(B3:AC3,"w"))
 
Upvote 0
I know this would be much easier for you folks if you had the spreadsheet but I'm quite certain that that is a bad notion on this forum. Thank you for your help, I'm sure it can be frustrating to try and work on something you can't see for yourself.
 
Upvote 0

Forum statistics

Threads
1,214,382
Messages
6,119,194
Members
448,874
Latest member
Lancelots

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