"COUNTIF" non-empty cells

Solved
CR34 -  
 CR34 -
Hello,

I am using the latest version of Excel for Mac.

I am looking for a formula that allows me to count non-empty cells but, if all are empty, returns a blank cell instead of 0.

Let me explain:

- There are 5 cells in a row.
- 3 of these cells are filled
- When entering the formula countif(a1:a5,"<>") I will get the result in a6: 3

If now all the cells are empty, in a6 I will get: 0

What I want is that in this case, I have a blank cell.

Thank you

1 réponse

didibonf Posted messages 418 Registration date   Status Membre Last intervention   96
 
Hello,
You can try:
if(countif(a1:a5,"<>") =0,"",countif(a1:a5,"<>"))

Best regards
2
CR34
 
Great, thank you very much dididonf, it's working perfectly!
0