Karen has attended:
Access Introduction course
Excel VBA Intro Intermediate course
Excel Maths
How do you write an equation to count a cell if it has a text content
RE: Excel Maths
Hi Karen
You need to use an array function as you are dealing with an array of cells.
Type the following into the cell where you want the value to go BUT do not press enter
=SUM(IF(ISTEXT(RANGE),1,0))
where range is the range of cells you want to test.
Then hold down the shift and the control key and then press enter. (This is the standard technique for entering an array function).
Your function will appear in the function bar in curley brackets
{=SUM(IF(ISTEXT(RANGE),1,0))} and should return the answer you are looking for.
The IF(ISTEXT(RANGE),1,0)) bit just checks each cell and returns 1 if the cell contains text. and the Sum bit just adds it all up
One small point, if you have a cell that has been explicitly formatted as text, then it will be counted as text even if you then type a number in. To fix this just explicitly reformat it as a number
Hope this helps