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.
 
I wonder if this might help. See attached.
 

Attachments

  • excel sheet.png
    excel sheet.png
    31.4 KB · Views: 7
Upvote 0

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
It's workable if you could drop your file on a sharing site and provide a link here

If that's not workable then please answer few questions below.

1) What if range (A3:AC3) all have "w"
2) What if range (A3:AC3) all have blanks
3) What if range (A3:AC3) some w, some blanks

Just let me know you desired answers for all 3 scenarios

Further what formula are you using in your range (A3:AC3) ???
 
Upvote 0
=COUNTIF(B3:AC3,"w") is what I'm using to count 'w's at the moment, which ignores blank spaces where there none. If there are no 'w's I need the Wins cell to say no wins, or '0' wins, specifically.

1) What if range (A3:AC3) all have "w" -- My current formula works just fine in that case, counting all the 'w's.
2) What if range (A3:AC3) all have blanks -- Then I need to count the lack of 'w's and report a '0' in the wins column.
3) What if range (A3:AC3) some w, some blanks -- This is exactly my case and the simple formula I've been using works as long as there is a single 'w' to be counted. If there are none, it fails to report '0'. That's what would I prefer, to see it report '0' when there are are no 'w's.
 
Upvote 0
Once again, many thanks for your help people. It is much appreciated.
I'll check in again in the morning.
 
Upvote 0
maybe this

Excel Formula:
=IF(COLUMNS(A3:AC3)=COUNTIF(A3:AC3,""),0,COUNTIF(A3:AC3,"w"))
 
Upvote 0
So I should be sleeping but plugged the suggested changes into place and still no go.
If you are still game, I'm going to upload the file itself, it has to be easier that way.
I strongly suggest you do not download any excel file but open them only in google docs.
Link below. Thanks so much for your time, it is not lost on me and is really generous of you.

 
Upvote 0
Ok, try it this way
Cell Formulas
RangeFormula
AI3:AI6AI3=A3
AJ3:AJ6AJ3=COUNTA(B3:AC3)
AK3:AK5AK3=IF(COUNTIF(B3:AC3,"w")=0,0,COUNTIF(B3:AC3,"w"))
AL3:AL6AL3=IF(OR(AJ3=0,AK3=0),"D",AK3/AJ3*100)
AK6AK6=COUNTIF(B6:AC6,"w")
Named Ranges
NameRefers ToCells
Print_Area=Sheet1!$A$1:$AL$39AI3:AL6
Cells with Conditional Formatting
CellConditionCell FormatStop If True
AJ2:AJ43Cell Value<$AH$8textNO
AJ2:AJ43Cell Value>=$AH$8textNO
AL2:AL54Cell Valuetop 1% valuestextNO
 
Upvote 0
Thank you very much for that. There remains the issue that cell AK3 does not show a zero though, which is the only thing I need to happen that doesn't already. Brian had no wins this round and I'd like to be able to see that at a glance.
 
Upvote 0

Forum statistics

Threads
1,214,954
Messages
6,122,461
Members
449,085
Latest member
ExcelError

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