Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

advanced excel class - excel maths

Forum home » Delegate support and help forum » Microsoft Excel Training and help » advanced excel class - Excel Maths

advanced excel class - Excel Maths

ResolvedVersion Standard

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

Excel tip:

Display Formulas Instead of Results in Excel 2010

By pressing Ctrl ~ once, Excel will display formulas rather than the results of the formulas. Press it again, and the results will appear again.

A much quicker and simpler way of displaying your formulas!

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.1 secs.