Skip to content
xlsoffice. All Rights Reserved
  • Home
  • Excel For Beginners
  • Excel Intermediate
  • Advanced Excel For Experts

Lookup and Reference Examples

  • CHOOSE function: Description, Usage, Syntax, Examples and Explanation
  • Left Lookup in Excel
  • How to reference named range different sheet in Excel
  • Excel Advanced Lookup using Index and Match Functions
  • INDEX function: Description, Usage, Syntax, Examples and Explanation

Data Analysis Examples

  • How To Insert and Customize Sparklines in Excel
  • Managing Conditional Formatting Rules in Excel
  • Conditional Formatting Icon Sets Examples in Excel
  • What-If Analysis: Scenarios and Goal Seek in Excel
  • Understanding Anova in Excel

Data Validation Examples

  • Excel Data validation no punctuation
  • Excel Data validation specific characters only
  • Excel Data validation with conditional list
  • Excel Data validation whole percentage only
  • Prevent invalid data entering in specific cells

How to check if cell contains number in Excel

by

To test if a cell (or any text string) contains a number, you can use the FIND function together with the COUNT function. In the generic form of the formula (above), A1 represents the cell you are testing. The numbers to be checked (numbers between 0-9) are supplied as an array.

Formula

=COUNT(FIND({0,1,2,3,4,5,6,7,8,9},A1))>0

Explanation

In the example the formula in C4 is:

=COUNT(FIND({0,1,2,3,4,5,6,7,8,9},B4))>0

How this formula works

The FIND function returns the position of the text when it’s found in the cell, and the #VALUE! error if not.  In the example,  the cell B4 contains the number “2” in the 29th position. So, if we just used this formula:

Worked Example:   How to check cell that contains specific text in Excel
=FIND("2",B4)

It would return the number 29 as the result. However, because we are giving the FIND function an array of items to check, it will return an array of results that looks like this:

{#VALUE!,#VALUE!,29,#VALUE!,#VALUE!,#VALUE!,#VALUE!,#VALUE!,#VALUE!,#VALUE!}

In other words, FIND checks the contents of B4 for each number and returns the result of each check as an item in the array.

Worked Example:   How to extract domain name from URL in Excel

After FIND returns the array, COUNT counts the items in the array. COUNT only counts numeric values, so any #VALUE! item in the array is treated as zero. COUNT will return a number greater than zero if there are any numbers in the array, and zero if not.

The last step in the formula is to compare the result the FIND and COUNT functions with zero. If there were any numbers found, the formula will return TRUE. If not, the formula will return FALSE.

Worked Example:   How to calculate project complete percentage in Excel

If you want to do something more than just test whether a cell contains text, you can wrap the formula in an IF statement like so:

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

Instead of returning TRUE or FALSE, the formula above returns “Yes” if B4 contains any numbers and “No” if not.

Cell equals number?

If you only need to test if a cell equals a number, you can use the ISNUMBER function like this:

=ISNUMBER(A1)

 

Post navigation

Previous Post:

How to check if cell contains one of many things in Excel

Next Post:

How to check cell that contains one of many with exclusions in Excel

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Learn Basic Excel

Ribbon
Workbook
Worksheets
Format Cells
Find & Select
Sort & Filter
Templates
Print
Share
Protect
Keyboard Shortcuts

Categories

  • Charts
  • Data Analysis
  • Data Validation
  • Excel Functions
    • Cube Functions
    • Database Functions
    • Date and Time Functions
    • Engineering Functions
    • Financial Functions
    • Information Functions
    • Logical Functions
    • Lookup and Reference Functions
    • Math and Trig Functions
    • Statistical Functions
    • Text Functions
    • Web Functions
  • Excel VBA
  • Excel Video Tutorials
  • Formatting
  • Grouping
  • Others
  • ASC function: Description, Usage, Syntax, Examples and Explanation
  • Change Case: Uppercase, Lowercase, Propercase in Excel
  • RIGHT, RIGHTB functions: Description, Usage, Syntax, Examples and Explanation
  • Get first name from full name — Manipulating NAMES in Excel
  • CLEAN function: Description, Usage, Syntax, Examples and Explanation
  • DATE function: Description, Usage, Syntax, Examples and Explanation
  • How to join date and text together in Excel
  • Display Days in month in Excel
  • How to calculate most recent day of week in Excel
  • List holidays between two dates in Excel
  • MIRR function: Description, Usage, Syntax, Examples and Explanation
  • FV function: Description, Usage, Syntax, Examples and Explanation
  • RATE function: Description, Usage, Syntax, Examples and Explanation
  • ACCRINTM function: Description, Usage, Syntax, Examples and Explanation
  • NPER function: Description, Usage, Syntax, Examples and Explanation
Acronyms, Abbreviations, Initialism & What They Stand For
© 2021 xlsoffice. All Rights Reserved | Teal Smiles