"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.