ICAEW.com works better with JavaScript enabled.
Exclusive

Excel, what’s occurrin’ 4 – number or text?

Author: Simon Hurst

Published: 24 Feb 2025

Exclusive content
Access to our exclusive resources is for specific groups of students, subscribers and members.

This series looks at some of the things that can go wrong in an Excel spreadsheet and at what we can do to avoid or resolve the issue. We start with the basics of making sure our numbers add up. Having looked at the use of the ROUND() function and the use of the potentially disastrous Precision as Displayed option and references to ranges that omit vital cells, we are going on to consider numbers that are not numbers.

Introduction

Spreadsheets, and technology in general for that matter, can be fantastic. Until that is, things don’t go as expected. It’s all too easy for an entire month’s productivity gains to be lost when sorting out a single spreadsheet problem. In this series, we will be look at some examples of Excel not doing what we expect and at how to deal with the problems.

So far, we have looked at the basic problem of our numbers not adding up and looked at solving the problem using Excel’s ROUND() function before warning about the use of the Precision as Displayed option and examining the issues of ranges that don’t include all the cells that they should. This time we will look at another cause of mysterious maths issues – numbers that are not always numbers (but are sometimes…)

When 63 isn’t the answer either

The last article’s investigation of incomplete cell ranges started with 4 cells, each containing the value 21, seeming to add up to 42. This time, our 4 cells seem to add up to 63:

Image of Excel spreadsheet - 63

If we look at our SUM() formula we can see that, this time we have used the correct range of cells. In fact, the issue is with the value in cell B10. It might look like the number 21, but it has been entered as a text value, preceded by an apostrophe. We have had to do a little more to make our text look like a number. In order to prevent the text value from looking different to our ‘proper’ numbers we need to change the alignment from the default left for text, to the right-alignment used as the default for numbers. Also, another of the Excel error-checking options that we featured last time, will highlight a ‘Number Stored as Text’:

Number stored as text

Although the error-check should normally highlight the issue with an indicator in the top left-hand corner of the cell, individual types of error check or error-checking in general can be turned off, or the error-check for specific cells can be ignored.

If we do suspect that some figures have been entered as text, there is another way to identify affected cells. The Home Ribbon tab, Editing Group, Find & Select, Go To Special dialog includes an option to select Constants, and then Text. If we were to select our range of cells, this will select our ’21 cell:

Goto special

May the force be with you

Just before we replace our text 21 with a proper number, we will create our total using a different formula. Rather than using SUM() we will just add our four cells using the plus operator:

=B9+B10+B11+B12

Coercion

Perhaps surprisingly, our formula returns the value of 84, despite the inclusion of a cell that contains text. This gives us the surprising result that the use of the SUM() function to add 4 cells gives a different result from adding the same four cells using the plus operator. This is by design. The SUM() function is designed to ignore text values in a range and add up the numeric values that remain. In contrast, using an arithmetic operator forces (or coerces) text values to be treated as numbers, as long as the text value only contains numeric characters. In effect, when we specifically use an arithmetic operator such as plus, Excel realises that we want to work with numbers and so it does its best to cooperate by ‘coercing’ text that only contains numeric characters to become a number.

May the FALSE be zero

In fact, coercion isn’t just restricted to text. It also works with Boolean (TRUE/FALSE) values. A value of TRUE is treated as the number 1 whereas FALSE is 0. This allows the use of the multiply operator to be used as an alternative to the IF() function. Multiplying a value by a TRUE value will return the value, multiplying it by a FALSE value will return Zero:

Boolean

Next time

In the next part of this series, we will examine the use of the IF() function in more detail.

Additional resources

You can explore all aspects of Excel in the ICAEW archive:

Archive and Knowledge Base

This archive of Excel Community content from the ION platform will allow you to read the content of the articles but the functionality on the pages is limited. The ION search box, tags and navigation buttons on the archived pages will not work. Pages will load more slowly than a live website. You may be able to follow links to other articles but if this does not work, please return to the archive search. You can also search our Knowledge Base for access to all articles, new and archived, organised by topic.

Open AddCPD icon

Add Verified CPD Activity

Introducing AddCPD, a new way to record your CPD activities!

Log in to start using the AddCPD tool. Available only to ICAEW members.

Add this page to your CPD activity

Step 1 of 3
Download recorded
Download not recorded

Please download the related document if you wish to add this activity to your record

What time are you claiming for this activity?
Mandatory fields

Add this page to your CPD activity

Step 2 of 3
Mandatory field

Add activity to my record

Step 3 of 3
Mandatory field

Activity added

An error has occurred
Please try again

If the problem persists please contact our helpline on +44 (0)1908 248 250