Cellwise Start free

Excel guide · 5 min read

How to check if a cell contains a number in Excel

Quick answerTo test whether a cell holds a number, use =ISNUMBER(B2): TRUE for a number, FALSE for text, blanks and errors. To test whether text contains any digit, like "14 Mill Lane", use =COUNT(FIND({0,1,2,3,4,5,6,7,8,9},C2))>0. Wrap either one in IF to return your own labels.

Sample data

Every result on this page was calculated from this sheet by the same spreadsheet engine the Cellwise app uses.

ABCDE
1SKUQty countedDelivery addressReceivedHas digit
2KB-2201414 Mill LaneOct 12, 2026TRUE
3MS-1158Flat B, Rose CourtpendingFALSE
4HD-480n/aUnit 3 Harbour ParkOct 19, 2026TRUE
5LS-3300Old RectoryFALSE
6CB-007PO Box 2712/10/2026TRUE
7WM-902 6The GranaryOct 21, 2026FALSE
8DK-115222a Station RoadOct 23, 2026TRUE

Download this sheet as an Excel practice file (.xlsx)

First decide which question you are asking

"Contains a number" means two different things. In a quantity column you want to know whether the cell is a real number Excel can add up. In an address or a product description you want to know whether the text has a digit anywhere in it. The formulas are different, so pick the right one.

The sample is a stock count pasted from a handheld scanner. Column B should be quantities, but it holds a typed 8 that came in as text, an "n/a", a blank and a " 6" with a leading space. Column C holds delivery addresses, some with house numbers and some without.

Is the cell a number? ISNUMBER

ISNUMBER returns TRUE only for real numbers. B2 holds 14, so it is TRUE. B3 shows 8 but is text, so ISNUMBER says FALSE, and so do "n/a", the blank and " 6". A zero is still a number: B5 is TRUE.

To count real numbers in a range, use =COUNT(B2:B8). It returns 3 here while COUNTA returns 6 filled cells, and that gap is your warning that three entries will be skipped by SUM, AVERAGE and MAX.

=IF(ISNUMBER(B3),"OK","Check")

Result: Check

Check: B3 looks like 8 but is stored as text.

Numbers stored as text: test what the cell would become

Imported data is full of numbers stored as text. Put -- in front of the cell to try turning it into a number, then test the result. "8" and " 6" convert, "n/a" does not. Watch out for blanks: -- turns an empty cell into 0, so ISNUMBER(--B6) is TRUE. That is why the formula below checks for "" before testing.

This nested IF sorts every cell into four groups, which is handy as a temporary audit column. To count the text numbers in one cell, =SUMPRODUCT(ISTEXT(B2:B8)*ISNUMBER(--B2:B8)) returns 2 (MS-115 and WM-902). Once you find them, convert the column with Data > Text to Columns > Finish, or click the green triangle and choose Convert to Number.

=IF(ISNUMBER(B3),"Number",IF(B3="","Blank",IF(ISNUMBER(--B3),"Number stored as text","Text")))

Result: Number stored as text

Number stored as text. B2 gives Number, B4 Text and B6 Blank.

Does the text contain any digit? COUNT and FIND

For addresses, ISNUMBER is always FALSE because the whole cell is text. Instead, look for each digit. FIND({0,1,2,3,4,5,6,7,8,9},C2) searches for all ten digits at once and returns a position for each one it finds and #VALUE! for the rest. COUNT counts only the positions, so anything above 0 means the cell contains a digit.

"14 Mill Lane" finds 1 and 4, so COUNT returns 2. "Flat B, Rose Court" returns 0. The array constant works in every Excel version without Ctrl+Shift+Enter. To find where the number starts, =MIN(FIND({0,1,2,3,4,5,6,7,8,9},C4&"0123456789")) returns 6 for "Unit 3 Harbour Park". The appended digits stop it erroring when a cell has none.

In newer Microsoft 365 builds, =REGEXTEST(C2,"[0-9]") does the same test. It is not in Excel 2021 or earlier.

=IF(COUNT(FIND({0,1,2,3,4,5,6,7,8,9},C2))>0,"Has number","No number")

Result: Has number

Has number: "14 Mill Lane" contains digits.

List the rows that contain a number with FILTER

To pull out every address with a digit, put the test in a helper column and filter on it. E2 holds =COUNT(FIND({0,1,2,3,4,5,6,7,8,9},C2))>0, copied down to E8. FILTER (Excel 365 and 2021) then keeps the TRUE rows.

A helper column is easier to check than one long formula. If you want it in one cell in Excel 365, =FILTER(C2:C8,BYROW(--ISNUMBER(FIND({0,1,2,3,4,5,6,7,8,9},C2:C8)),LAMBDA(r,SUM(r)))>0) works the same way. For the quantity column you do not need a helper: =FILTER(A2:A8,NOT(ISNUMBER(B2:B8))) lists the four SKUs whose count is not a real number.

=FILTER(C2:C8,E2:E8)

Result: spills 4 rows × 1 column

14 Mill Lane
Unit 3 Harbour Park
PO Box 27
2a Station Road

4 addresses: 14 Mill Lane, Unit 3 Harbour Park, PO Box 27 and 2a Station Road.

Dates are numbers too

Excel stores a date as a day count, so =ISNUMBER(D2) is TRUE for 12 October 2026. ISNUMBER cannot tell a date from a quantity, a time or a percentage. If a column should hold dates, ISNUMBER is the right test for "is this a real date": "pending" and the text date in D6 both return FALSE.

Be careful with the -- trick on dates. =ISNUMBER(--D6) is TRUE because Excel can read "12/10/2026" as a date, so text dates pass the "number stored as text" test as well. Whether it reads that as 12 October or 10 December depends on your regional settings.

=ISNUMBER(D2)

Result: TRUE

TRUE: the received date is a real date, which Excel stores as a number.

Highlight the cells instead

To see the problem cells at a glance without a formula column, use Go To Special. It selects them so you can colour or fix them in one go.

  1. Select B2:B8.
  2. Go to Home > Find & Select > Go To Special.
  3. Choose Constants, untick Numbers, Logicals and Errors, leave Text ticked and click OK.
  4. Every cell holding text is now selected. Fill them with a colour, or use the warning triangle to convert them.

Common mistakes

Using a wildcard to find numbers

=COUNTIF(B2:B8,"*2*") returns 0 even though B8 holds 22. Wildcards only match text, never real numbers. Use COUNT for numbers or the FIND test for digits inside text.

ISNUMBER says FALSE for a cell that shows a number

It is a number stored as text, often from a CSV or a leading apostrophe. Test with ISNUMBER(--B3) and convert the column. Non-breaking spaces from web pages also block the conversion; remove them with SUBSTITUTE(B3,CHAR(160),"").

Blank cells counted as numbers

--B6 is 0 for an empty cell, so ISNUMBER(--B6) is TRUE. Check B6<>"" first, as in the four-way audit formula.

Leaving out COUNT around FIND

FIND({0,...,9},C2) returns ten results, not one TRUE or FALSE, so IF cannot use it directly. COUNT turns the ten results into one number you can compare with 0.

FAQ

How do I check if a cell is a number or text?

Use =ISNUMBER(A2) for numbers and =ISTEXT(A2) for text. Both are FALSE for an empty cell. =SUMPRODUCT(--ISTEXT(B2:B8)) counts the text cells in a range: 3 in the sample.

How do I check if a cell contains a specific number?

Inside text, use =ISNUMBER(SEARCH(27,C6)), which is TRUE for "PO Box 27". SEARCH treats the number as text. In a numeric column, compare directly: =B2=14.

How do I check that a cell contains only a number greater than 0?

Combine the tests: =AND(ISNUMBER(B2),B2>0). B2 passes; B5 is a number but 0, so it fails. For data entry, put the same rule in Data > Data Validation with Allow set to Decimal or Whole number.

Does ISNUMBER work on a range?

In Excel 365, =ISNUMBER(B2:B8) spills one TRUE or FALSE per cell. To get a single answer, count them with =SUMPRODUCT(--ISNUMBER(B2:B8)), or use COUNT(B2:B8), which gives the same 3.

Functions used

Related guides

Updated