Help with counting in Excel with a condition

Closed
Jilly - May 7, 2010 at 09:48 AM
rizvisa1 Posts 4479 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - May 7, 2010 at 10:16 AM
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

rizvisa1 Posts 4479 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 767
May 7, 2010 at 10:16 AM
Try this

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