Excel if Formula text vs numbers

Solved/Closed
Report
-
 NW -
Hello,

I am trying to run an If formula that if the cell range contain text then use Counta but if cells contain number use Sum. At present I'm using:
=IF(SUM(G47:BG47)>0,SUM(G47:BG47),COUNTA(G47:BG47))

Only issue I have is that some of the number cells equal 0 (due to formulas in the cells), which are then processed with Counta, but if I use >=0 it no longer counts the text cells

1 reply

Posts
1864
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
804
"cell range contain text"
you mean by this all the cells in the range are either text or number and no mixed entries.

suppose your range is A1:A10 then use this formula

=IF(COUNTA(A1:A10)=COUNT(A1:A10),SUM(A1:A10),COUNTA(A1:A10))

change the range to suit you.
0
Thanks works perfect!
0