Help with counting in Excel with a condition [Closed]

Report
-
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
-
Hi,
I would like Excel to count a range of non-blank cells and enter the number but if all the cells in the range are blank, I'd like it to fill in with an "x". Is this possible?
Thanks
Jilly

1 reply

Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
766
Try this

=IF(SUMPRODUCT(1 * (A1:A50 =""))+ SUMPRODUCT(1 * (A1:A50<>""))=SUMPRODUCT(1 * (A1:A50 ="")), "X", COUNTA(A1:A50))

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!