Check if is number excel

Return value 

A logical value (TRUE or FALSE)

Usage notes 

The ISNUMBER function returns TRUE when a cell contains a number, and FALSE if not. You can use ISNUMBER to check that a cell contains a numeric value, or that the result of another function is a number.

The ISNUMBER function takes one argument, value, which can be a cell reference, a formula, or a hardcoded value. Typically, value is entered as a cell reference like A1. When value is a number, the ISNUMBER function will return TRUE. Otherwise, ISNUMBER will return FALSE.

Examples

The ISNUMBER function returns TRUE if value is numeric:

=ISNUMBER("apple") // returns FALSE
=ISNUMBER(100) // returns TRUE

If cell A1 contains the number 100, ISNUMBER returns TRUE:

=ISNUMBER(A1) // returns TRUE

If a cell contains a formula, ISNUMBER checks the result of the formula:

=ISNUMBER(2+2) // returns TRUE
=ISNUMBER(2^3) // returns TRUE
=ISNUMBER(10 &" apples") // returns FALSE

Note: the ampersand (&) is the concatenation operator in Excel. When values are concatenated, the result is text.

Count numeric values

To count cells in a range that contain numbers, you can use the SUMPRODUCT function like this:

=SUMPRODUCT(--ISNUMBER(range))

The double negative coerces the TRUE and FALSE results from ISNUMBER into 1s and 0s and SUMPRODUCT sums the result.

Notes

  • ISNUMBER will return TRUE for Excel dates and times since they are numeric.
  • ISNUMBER will return FALSE for empty cells and errors.

Return to Excel Formulas List

Download Example Workbook

Download the example workbook

This tutorial demonstrates how to check if a cell is a number or text in Excel and Google Sheets.

cell is number text Main Function

Check Cell for Number or Text

We can check if a cell is a number by using the ISNUMBER Function or check if a cell is text with the ISTEXT Function.

ISNUMBER Function

The ISNUMBER Function checks if a value is a number. It returns TRUE if the value is a number and FALSE if it’s not.

=ISNUMBER(B3)

ISNUMBER

Knowing if a cell value is a number helps avoid errors when working with formulas. Numbers are sometimes stored as text, i.e. B4 (5000) in the example above, and that can result in errors in formulas referencing that cell.

In this example, the date, phone number, and time values all returned TRUE. These are regarded as numeric values in Excel and Google Sheets.

ISTEXT Function

The ISTEXT Function checks if a cell is text. It returns TRUE if the value is a text string and FALSE if it’s not.

=ISTEXT(B3)

ISTEXT

In this example, although the value in B5 (2350) is a number, it’s written within quotes and therefore stored as a text string. That’s why it returns TRUE.

Check if Cell is a Number or Text in Google Sheets

These formulas (ISNUMBER and ISTEXT) work exactly the same in Google Sheets as in Excel.

cell is number text Google Function

Home / Excel Formulas / Check IF a Cell Value is a Number

To check if a cell value is a number or not, you can use IF + ISNUMBER in a combination. In this combination ISNUMBER tests if a value is a number or not and returns the result as TRUE and FALSE. After that, IF uses that TRUE or FALSE to return a meaningful value in the result.

check-if-cell-value-is-a-number

To write this formula you can use the below steps.

  1. First, enter the IF function of a cell.
  2. After that, in the first argument of the IF (logical_text) enter the ISNUMBER function.
  3. Next, in the ISNUMBER function, refer to the cell where you want to test the number.
  4. Now, in the [value_if_true] argument, enter Yes, and in the [value_if_false] argument, enter No. You can also use some other meaningful values if you need.
  5. In the end, enter the closing parentheses and hit enter to get the result.
formula-to-test-cell-value-is-number

The moment you hit enter it returns YES or NO according to the value that you have in the referred cell.

How Does This Formula Works?

As I said, in this formula we have two functions, IF + ISNUMBER. In cell A2, you have a number that’s why you have TRUE in the result by the ISNUMBER.

how-this-formula-works

Now we have TRUE, which is why IF returns YES in the result for the value that you have in cell A2.

Same Formula in Mac

If you use Excel for Mac, the formula will be the same and can be written using the same functions.

same-formula-in-mac

Excel stores a date as a number. And when you have a date in a cell, this ISNUMBER will treat that date as a number and return TRUE in the result. I’m trying to find a solution to this problem, still not able to differentiate between a number and a date while using this formula.

Download Sample File

  • Ready

More

  • Check IF 0 (Zero) Then Blank in Excel
  • Check IF a Value Exists in a Range in Excel
  • Combine IF and AND Functions in Excel
  • Combine IF and OR Functions in Excel
  • IF Cell is Blank (Empty) using IF + ISBLANK in Excel
  • IF Negative Then Zero (0) in Excel
  • Check IF a Cell Contains a Partial Text
  • Check IF a Cell Value is a Number
  • IF a Cell Value Starts with a Text or a Number
  • Median with IF (Conditional Criteria)

⇠ Back to Excel Formula List

Содержание

  1. Check if Cell is a Number or Text – Excel & Google Sheets
  2. Check Cell for Number or Text
  3. ISNUMBER Function
  4. ISTEXT Function
  5. Check if Cell is a Number or Text in Google Sheets
  6. Check If Any Cell in Range is a Number – Excel & Google Sheets
  7. Check if Range Contains a Number
  8. ISNUMBER Function
  9. SUMPRODUCT Function
  10. Google Sheets – Check If Any Cell in Range is a Number
  11. ISNUMBER Function Examples – SEARCH, IF, NOT – Excel, VBA, & Google Sheets
  12. How to Use the ISNUMBER Function
  13. Things to Know
  14. If Cell is Number Then
  15. Check if Not Number
  16. ISNUMBER & SEARCH Formula
  17. ISNUMBER & FIND – Case Sensitive
  18. ISNUMBER & MATCH
  19. Validate Cell Input
  20. Data Validation – Force Text Entry
  21. Test if Any Cell in Range is a Number
  22. Highlight Cells That Contain Numbers
  23. Other Logical Functions
  24. ISNUMBER in Google Sheets
  25. ISNUMBER Examples in VBA
  26. ISNUMBER Function
  27. What is the Excel ISNUMBER Function?
  28. Formula
  29. How to use the ISNUMBER Excel Function?
  30. Example 1
  31. Example 2 – Check if Excel contains a number in a cell
  32. A few notes about the ISNUMBER Function
  33. Additional Resources
  34. ISNUMBER Function
  35. Related functions
  36. Summary
  37. Purpose
  38. Return value
  39. Arguments
  40. Syntax
  41. Usage notes
  42. Examples
  43. Count numeric values

Check if Cell is a Number or Text – Excel & Google Sheets

Download the example workbook

This tutorial demonstrates how to check if a cell is a number or text in Excel and Google Sheets.

Check Cell for Number or Text

We can check if a cell is a number by using the ISNUMBER Function or check if a cell is text with the ISTEXT Function.

ISNUMBER Function

The ISNUMBER Function checks if a value is a number. It returns TRUE if the value is a number and FALSE if it’s not.

Knowing if a cell value is a number helps avoid errors when working with formulas. Numbers are sometimes stored as text, i.e. B4 (5000) in the example above, and that can result in errors in formulas referencing that cell.

In this example, the date, phone number, and time values all returned TRUE. These are regarded as numeric values in Excel and Google Sheets.

ISTEXT Function

The ISTEXT Function checks if a cell is text. It returns TRUE if the value is a text string and FALSE if it’s not.

In this example, although the value in B5 (2350) is a number, it’s written within quotes and therefore stored as a text string. That’s why it returns TRUE.

Check if Cell is a Number or Text in Google Sheets

These formulas (ISNUMBER and ISTEXT) work exactly the same in Google Sheets as in Excel.

Источник

Check If Any Cell in Range is a Number – Excel & Google Sheets

This tutorial will demonstrate how to check if any cell in a range contains a number in Excel and Google Sheets.

Check if Range Contains a Number

To test if any cell in a range contains a number, we will use the ISNUMBER and SUMPRODUCT Functions.

ISNUMBER Function

The ISNUMBER Function does exactly what its name implies. It tests if a cell is a number, outputting TRUE or FALSE.

SUMPRODUCT Function

The ISNUMBER Function only tests a single cell, so we must find a way to test the entire range. This is where the SUMPRODUCT Function comes in. The SUMPRODUCT Function sums together an array of values. So if we can test each cell individually, outputting a 1 (TRUE) or 0 (FALSE) if each cell as text, then we can sum the values together. If the sum is greater than 0 than we know at least one cell contained text.

First, here is the final calculation:

Now let’s walk through it.

Note: the double negatives converts the TRUE/FALSE into 1 / 0. Alternatively you could multiply the ISNUMBER Function by *1

Instead of outputting TRUE / FALSE, you can use an IF Statement to output other text or calculations:

Google Sheets – Check If Any Cell in Range is a Number

All of the above examples work exactly the same in Google Sheets as in Excel.

Источник

ISNUMBER Function Examples – SEARCH, IF, NOT – Excel, VBA, & Google Sheets

Download the example workbook

This tutorial demonstrates how to use the ISNUMBER Function in Excel and Google Sheets to test if a cell is a number.

How to Use the ISNUMBER Function

The ISNUMBER Function tests if a cell is a numerical value. If yes, it returns TRUE, otherwise it returns FALSE.

Things to Know

  • In Excel, Dates and Times are stored as numeric values. ISNUMBER will return TRUE when evaluating Dates and Times.
  • Numbers stored as text will return FALSE.

If Cell is Number Then

Often, you’ll want to combine an “IS” function, like ISNUMBER, with the IF Function. With the IF Function, instead of returning a simple TRUE or FALSE, you can output specific text or perform specific actions if a cell is a number or not.

Check if Not Number

With the NOT Function, you can test if a cell is not a number.

ISNUMBER & SEARCH Formula

One of the most useful features of the ISNUMBER Function is the ability to evaluate if certain functions return a numerical value. For example, the SEARCH Function searches a cell for text. If the text is found, it’s numerical position is returned. If the text is not found an error is returned. By using the ISNUMBER Function we can return TRUE / FALSE if the text is found.

ISNUMBER & FIND – Case Sensitive

The FIND Function works exactly the same as the SEARCH Function, except the FIND Function is case sensitive. In other words, the FIND Function will return FALSE when searching for “string” in “STRING” because the cases do not match.

ISNUMBER & MATCH

The ISNUMBER Function can also be paired with the MATCH Function in a similar fashion. The MATCH Function searches for a value in a range of values. If the value is found, the function returns it’s numerical position. If it’s not found, it returns an error.

Validate Cell Input

One use of the ISNUMBER Function is to validate the contents of a cell. For example, you might have an input form that requires a numerical value. With the ISNUMBER Function you can test if the user entered a numerical value, alerting them if they did not.

Data Validation – Force Text Entry

The above example was “weak” data validation; the user can ignore the warning message. Instead, we can use Data Validation to disallow non-numerical values.

Go to: Data Ribbon > Data Validation > Data Validation

and then select from one of these options:

Test if Any Cell in Range is a Number

Follow the link above to learn how this function works.

Highlight Cells That Contain Numbers

One last thing you can do with the ISNUMBER Function is highlight cells that contain text. We can do this by creating Conditional Formatting based on a rule.

  1. Select all the cells that you want to check
  2. Go to Home Ribbon >Conditional Formatting >New Rule
  3. Select ‘Use a formula to determine which cells to format
  4. Enter the formula =ISNUMBER(A2)
  5. Click the Format button and choose your desired formatting
  6. Click OK twice to quit and save.

Other Logical Functions

Excel / Google Sheets contain many other logical functions to perform other logical tests. Here is a list:

IF / IS Functions
iferror
iserror
isna
iserr
isblank
isnumber
istext
isnontext
isformula
islogical
isref
iseven
isodd

ISNUMBER in Google Sheets

The ISNUMBER Function works exactly the same in Google Sheets as in Excel:

ISNUMBER Examples in VBA

You can also use the ISNUMBER function in VBA. Type:

For the function arguments (value, etc.), you can either enter them directly into the function, or define variables to use instead.

Источник

ISNUMBER Function

Checks if a cell contains a number or not

What is the Excel ISNUMBER Function?

The Excel ISNUMBER Function[1] is categorized under Information functions. The function checks if a cell in Excel contains a number or not. It will return TRUE if the value is a number and if not, a FALSE value. For example, if the given value is a text, date, or time, it will return FALSE.

As a financial analyst, when dealing with large amounts of data, ISNUMBER Excel function helps in testing if a given result of a formula is a number or not.

Formula

=ISNUMBER(value)

The Excel ISNUMBER function uses the following arguments:

  1. Value (required argument) – This is the expression or value that needs to be tested. It is generally provided as a cell address.

The ISNUMBER Excel function will return a logical value, which is TRUE or FALSE.

How to use the ISNUMBER Excel Function?

To understand the uses of the ISNUMBER Excel function, let’s consider a few examples:

Example 1

Let’s first understand how the function behaves using the following set of data:

Data Formula Result Remark
1 =ISNUMBER(1) TRUE The value provided is a number, so the function returned TRUE.
TEXT =ISNUMBER(TEXT) FALSE The function returns FALSE for text values.
10/20 =ISNUMBER(10/20) TRUE The formula will return a number, so the function returned TRUE.
#NAME? =ISNUMBER(#NAME?) FALSE The function returned FALSE for formula errors.
=ISNUMBER( ) FALSE The result is FALSE, as it is not a number.

Example 2 – Check if Excel contains a number in a cell

Suppose we wish to allow values that contain the text string XY. Using ISNUMBER along with data validation, we can check if Excel contains “XY” in the cell. Suppose we are given the following data:

To allow only values that contain a specific text string, we can use data validation with a customized formula based on the FIND and ISNUMBER Excel functions. Essentially, it checks if Excel contains a number in the cell or not. To do this, we will apply data validation to C4:C11 cells. To apply the data validation, click on the Data tab, go to Data Tools, and click on Data Validation, as shown below:

Now, select Data validation and click on Settings. As shown below, enter the formula =ISNUMBER(FIND(“XY”,C4)). To activate the formula cell, you need to choose Validation criteria – Allow – Custom.

When someone tries to change XY into something else, data validation rules are triggered, particularly when a user adds or changes a cell value.

The FIND function is shaped to search for the text “XY” in cell C4. If found, FIND will return a numeric position (e.g., 2, 4, 5, etc.) for the starting point of the text in the cell. If the text is not found, FIND will return an error. For C4, FIND will return 5, since “XY” starts at character 5.

The result from using the FIND function above is then evaluated by the ISNUMBER Excel function. For any numeric result returned by FIND, ISNUMBER will return TRUE and validation will succeed. When text is not found, FIND will return an error, ISNUMBER will return FALSE, and the input will fail validation.

A few notes about the ISNUMBER Function

  1. The function is part of the IS functions that return the logical values TRUE or FALSE.
  2. The function doesn’t return any error such as #NAME!, #N/A!, etc., as it just evaluates data.
  3. The function was introduced in MS Excel 2000.

Additional Resources

Thanks for reading CFI’s guide to important Excel functions! By taking the time to learn and master these functions, you’ll significantly speed up your financial analysis. To learn more, check out these additional CFI resources:

Источник

ISNUMBER Function

Summary

The Excel ISNUMBER function returns TRUE when a cell contains a number, and FALSE if not. You can use ISNUMBER to check that a cell contains a numeric value, or that the result of another function is a number.

Purpose

Return value

Arguments

Syntax

Usage notes

The ISNUMBER function returns TRUE when a cell contains a number, and FALSE if not. You can use ISNUMBER to check that a cell contains a numeric value, or that the result of another function is a number.

The ISNUMBER function takes one argument, value, which can be a cell reference, a formula, or a hardcoded value. Typically, value is entered as a cell reference like A1. When value is a number, the ISNUMBER function will return TRUE. Otherwise, ISNUMBER will return FALSE.

Examples

The ISNUMBER function returns TRUE if value is numeric:

If cell A1 contains the number 100, ISNUMBER returns TRUE:

If a cell contains a formula, ISNUMBER checks the result of the formula:

Note: the ampersand (&) is the concatenation operator in Excel. When values are concatenated, the result is text.

Count numeric values

To count cells in a range that contain numbers, you can use the SUMPRODUCT function like this:

The double negative coerces the TRUE and FALSE results from ISNUMBER into 1s and 0s and SUMPRODUCT sums the result.

Источник

I have to find out if my cells text is a numeric value and wanted to use an elegant non VBA method that doesn’t impede on its current state or value.

What I’ve found is that the ISNUMBER() function only works if the cells are number formatting or has no spaces if text formatting e.g.:

number as text examples

For the first three I’ve used =ISNUMBER(...) and my last attempt is =ISNUMBER(TRIM(...)).

The only method I’ve used that doesn’t use VBA is to override my current values using text to columns then use the =ISNUMBER() function.

Note: I am proficient with VBA and Excel and understand I could create a user-defined function. But I don’t want to as this imposes a macro required workbook or an add-in to be installed, which I can and have done in some cases.

I will appreciate any advice, thoughts (even if they tell me it can’t be done) or VBA solutions (won’t be marked as answer however).

asked Apr 30, 2013 at 1:05

glh's user avatar

5

Try multiplying the cell value by 1, and then running the IsNumber and Trim functions, e.g.,:

=IsNumber(Trim(A1)*1)

answered Apr 30, 2013 at 1:10

David Zemens's user avatar

3

Assuming the value you want to convert is in A1 you can use the following formula:

=ISNUMBER(VALUE(TRIM(CLEAN(A1)))

Here the functions clean and trim are removing whitespace and none printable characters. The function value converts a string to a number, and with the converted string we can check if the value is a number.

answered Apr 30, 2013 at 2:02

Sam Plus Plus's user avatar

1

The shortest answer I’ve got to my question is:

=N(-A1)

Thanks brettdj

answered Apr 30, 2013 at 12:03

glh's user avatar

glhglh

5131 gold badge4 silver badges12 bronze badges

I know this post is old but I found this very useful in this case
I had a formula that returned (333), even though it is a number and ISNUMBER will say it is a number even though I did not want an answer if it had characters other than digits. The following worked for me.

=IF(AND(ISNUMBER(--(MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1)))),"Is Number","")

It works if there is ANY characters other than digits. If you just want a true false drop the IF

=AND(ISNUMBER(--(MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1))))

As David Zemens stated

=IsNumber(Trim(A1)*1)

Works but if there is a «-» or the number is in parentheses it will say it is a number.

I hope this helps you or others.

answered Apr 8, 2016 at 18:14

Mouthpear's user avatar

MouthpearMouthpear

511 silver badge5 bronze badges

if anyone needs to filter cells that contain anything that is not numeric:

=AND(SUMPRODUCT(--ISNUMBER(--MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1)))=LEN(A1),A1<>"")

decimals and negatives result FALSE

answered Oct 6, 2017 at 7:58

robotik's user avatar

I’m pretty late to the party, but, possibly the easiest, or shortest genuine test (note that the N function converts the number) is =ISNUMBER(--A1).

Using the examples you posted above…

Testing values using ISNUMBER

As with a lot of Excel shortcuts, the ‘—‘ forces Excel to assume the value afterward is a number, then all spaces are ignored. It’s as if you had typed --123 directly into a box (— obviously gives a positive number).

The third example also shows that other textual values in the string don’t simply cause an error output for ISNUMBER.

Number ISNUMBER() Format Comments
123456 TRUE Numeric Plain number
123456 TRUE Text Number as text
123456A FALSE Text Number with ‘A’ tagged on the end
123456 TRUE Text Number prefixed with four spaces

answered Mar 11, 2022 at 16:48

Paul's user avatar

PaulPaul

1239 bronze badges

Excel allows a user to check if a value is numeric, by using the ISNUMBER function. This step by step tutorial will assist all levels of Excel users in checking if a value or a value of a cell isnumeric.

Figure 1. The result of the ISNUMBER function

Syntax of the ISNUMBER Formula

The generic formula for the ISNUMBER function is:

=ISNUMBER(value)

The parameter of the ISNUMBER function is:

  • value – a value or a cell which we want to check if it is numeric.

If a selected value is numeric, the function will return TRUE as a result. Otherwise, it will return FALSE.

Check If Cells Value is Numeric by the ISNUMBER function

In our example, we want to check if the value from the cell B3 is a number. In B3, we put 2 as the value.

The formula is:

=ISNUMBER(B3)

The parameter value is the cell B3, while the result is in the cell C3.

To apply the ISNUMBER function, we need to follow these steps:

  • Select cell C3 and click on it
  • Insert the formula: =ISNUMBER(B3)
  • Press enter

Figure 2. Using the ISNUMBER function to check if the value in the cell is numeric

The value in B3 is numeric, so the function returns Boolean TRUE as a result in the cell C3.

Notes

There are two specific cases when using the ISNUMBER function:

  • Checking if date value is numeric. The function will always return TRUE for the date because Excel stores dates as numbers:

Figure 3. The ISNUMBER checking a date

The date 12-10-18 is internally stored as 43385 is Excel. Because of that, the ISNUMBER returns TRUE as a result.

  • Checking numbers stored as text. If the number is stored as a text, the ISNUMBER will return FALSE:

Figure 4. The ISNUMBER checking the number stored as text

In the cell B3, we put 3, but the cell is formatted as text. Because of that, the ISNUMBER returns FALSE as a result.

Most of the time, the problem you will need to solve will be more complex than a simple application of a formula or function. If you want to save hours of research and frustration, try our live Excelchat service! Our Excel Experts are available 24/7 to answer any Excel question you may have. We guarantee a connection within 30 seconds and a customized solution within 20 minutes.

How to check if a specific Column has Integer on each cell, and if it contains a string, Insert a blank cell to row in question.

Zoe stands with Ukraine's user avatar

asked Dec 10, 2009 at 13:50

Tom's user avatar

Untested:

Dim row As Long
Dim col As Long

col = 4      ' Whatever column you want to check

For row = 1 To 100     ' How many rows you want to check
    If Not IsNumeric(Cells(row, col).Value) Then
        ' Do whatever you want to do in this case
    End If
Next row

If you clarify what you mean by «Insert a blank cell to row in question«, I will try to update my solution.

answered Dec 10, 2009 at 13:59

Heinzi's user avatar

HeinziHeinzi

166k57 gold badges361 silver badges516 bronze badges

3

You can check even check with a forumla that the column contains no none-numbers only

=COUNTBLANK(AAA:AAA)-COUNTBLANK(B:B)=COUNT(B:B)

where I assume that column AAA:AAA is empty.

answered Dec 10, 2009 at 14:07

akuhn's user avatar

akuhnakuhn

27.2k2 gold badges76 silver badges91 bronze badges

A mix of the other answers for bigger data.
It first checks if the colomn has none Numbers only and if not, checks where.

Dim row As Long
Dim LastRow As Long
LastRow = Range("B" & Rows.Count).End(xlUp).Row   'if you want the colomn B

If Excel.WorksheetFunction.CountBlank(Range("AAA:AAA")) - Excel.WorksheetFunction.CountBlank(Range("B:B")) = Excel.WorksheetFunction.Count(Range("B:B")) Then
For row = 1 To LastRow     

    If Not IsNumeric(Range("B" & row).Value) Then
        ' Do whatever you want to do in this case
    End If
Next row
End if

answered Nov 3, 2017 at 10:03

Pierre44's user avatar

Pierre44Pierre44

1,7012 gold badges10 silver badges32 bronze badges

Function IsInt(i As Variant) As Boolean
'checks if value i is an integer. returns True if it is and False if it isn't
    IsInt = False
    If IsNumeric(i) Then
        If i = Int(i) Then
            IsInt = True
        End If
    End If
End Function

Function IsString(s As Variant) As Boolean
'checks if variable s is a string, returs True if it is and False if not
    IsString = True
    If s = "" Then
        IsString = False
    Else
        If IsNumeric(s) Then
            IsString = False
        End If
    End If
End Function



Sub CheckInts(c As Integer)
'c = column number to check
'goes through all cells in column c and if integer ignores, if string sets to ""

Dim r, lastrow As Integer
    
    lastrow = Sheet1.UsedRange.rows.Count 'find last row that contains data
    
    For r = 1 To lastrow
        If Not IsInt(Cells(r, c).Value) Then
            If IsString(Cells(r, c).Value) Then
                Cells(r, c).Value = ""
            End If
        End If
    Next r
End Sub   

then just call CheckInts passing in the column number you want to change
e.g. CheckInts(2) will change column 2

answered Jul 3, 2020 at 13:55

Oli's user avatar

OliOli

391 gold badge1 silver badge6 bronze badges

Excel for Microsoft 365 Excel for Microsoft 365 for Mac Excel for the web Excel 2021 Excel 2021 for Mac Excel 2019 Excel 2019 for Mac Excel 2016 Excel 2016 for Mac Excel 2013 Excel Web App Excel 2010 Excel 2007 Excel for Mac 2011 Excel Starter 2010 More…Less

Description

Each of these functions, referred to collectively as the IS functions, checks the specified value and returns TRUE or FALSE depending on the outcome. For example, the ISBLANK function returns the logical value TRUE if the value argument is a reference to an empty cell; otherwise it returns FALSE.

You can use an IS function to get information about a value before performing a calculation or other action with it. For example, you can use the ISERROR function in conjunction with the IF function to perform a different action if an error occurs:

=
IF(
ISERROR(A1), «An error occurred.», A1 * 2)

This formula checks to see if an error condition exists in A1. If so, the IF function returns the message «An error occurred.» If no error exists, the IF function performs the calculation A1*2.

Syntax

ISBLANK(value)

ISERR(value)

ISERROR(value)

ISLOGICAL(value)

ISNA(value)

ISNONTEXT(value)

ISNUMBER(value)

ISREF(value)

ISTEXT(value)

The IS function syntax has the following argument:

  • value    Required. The value that you want tested. The value argument can be a blank (empty cell), error, logical value, text, number, or reference value, or a name referring to any of these.

Function

Returns TRUE if

ISBLANK

Value refers to an empty cell.

ISERR

Value refers to any error value except #N/A.

ISERROR

Value refers to any error value (#N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME?, or #NULL!).

ISLOGICAL

Value refers to a logical value.

ISNA

Value refers to the #N/A (value not available) error value.

ISNONTEXT

Value refers to any item that is not text. (Note that this function returns TRUE if the value refers to a blank cell.)

ISNUMBER

Value refers to a number.

ISREF

Value refers to a reference.

ISTEXT

Value refers to text.

Remarks

  • The value arguments of the IS functions are not converted. Any numeric values that are enclosed in double quotation marks are treated as text. For example, in most other functions where a number is required, the text value «19» is converted to the number 19. However, in the formula ISNUMBER(«19»), «19» is not converted from a text value to a number value, and the ISNUMBER function returns FALSE.

  • The IS functions are useful in formulas for testing the outcome of a calculation. When combined with the IF function, these functions provide a method for locating errors in formulas (see the following examples).

Examples

Example 1

Copy the example data in the following table, and paste it in cell A1 of a new Excel worksheet. For formulas to show results, select them, press F2, and then press Enter. If you need to, you can adjust the column widths to see all the data.

Formula

Description

Result

=ISLOGICAL(TRUE)

Checks whether TRUE is a logical value

TRUE

=ISLOGICAL(«TRUE»)

Checks whether «TRUE» is a logical value

FALSE

=ISNUMBER(4)

Checks whether 4 is a number

TRUE

=ISREF(G8)

Checks whether G8 is a valid reference

TRUE

=ISREF(XYZ1)

Checks whether XYZ1 is a valid reference

FALSE

Example 2

Copy the example data in the following table, and paste it in cell A1 of a new Excel worksheet. For formulas to show results, select them, press F2, and then press Enter. If you need to, you can adjust the column widths to see all the data.

Data

Gold

Region1

#REF!

330.92

#N/A

Formula

Description

Result

=ISBLANK(A2)

Checks whether cell A2 is blank.

FALSE

=ISERROR(A4)

Checks whether the value in cell A4, #REF!, is an error.

TRUE

=ISNA(A4)

Checks whether the value in cell A4, #REF!, is the #N/A error.

FALSE

=ISNA(A6)

Checks whether the value in cell A6, #N/A, is the #N/A error.

TRUE

=ISERR(A6)

Checks whether the value in cell A6, #N/A, is an error.

FALSE

=ISNUMBER(A5)

Checks whether the value in cell A5, 330.92, is a number.

TRUE

=ISTEXT(A3)

Checks whether the value in cell A3, Region1, is text.

TRUE

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

This post will guide you on how to check if a number is an integer in Excel using different methods. Excel provides built-in functions such as the INT and MOD functions that you can use to determine if a number is an integer.

Additionally, you can create a user-defined function using VBA code to check if a number is an integer. By using these methods, you can easily determine if a number is an integer and use it in your calculations or data analysis in Excel.

Table of Contents

  • 1. Check If Value is Integer Using INT Function
  • 2. Check If a Number is Integer Using MOD Function
  • 3. Check If a Number is Integer with User Defined Function (VBA Code)
  • 4. Video: Check If Cell Value is Integer
  • 5. Related Functions

1. Check If Value is Integer Using INT Function

Assuming that you have a list of data in range B1:B5, in which contain numeric values. And you want to test each cell value if it is an integer, if true, returns TRUE, otherwise, returns FALSE. How can I do it. You can use a formula based on the INT function to achieve the result. Like this:

=INT(B1)=B1

Type this formula into a blank cell, such as: Cell C1, and press Enter key on your keyboard. Then copy this formula from cell C1 to range C2:C5 to apply this formula to check values.

check if number is integer1

Let’s see how this formula works:

The INT function try to extract the integer portion from a given cell value, if the returned value is equal to the default cell value, it indicated that numeric value is an integer.

2. Check If a Number is Integer Using MOD Function

You can also use the MOD function in combination with IF function to check if a cell value is integer in Microsoft Excel Spreadsheet. Just use the following MOD formula:

=IF(MOD(B1,1)=0, "TRUE", "FALSE ")

Select a cell where you want to display the result, then enter this formula, press Enter.

How to Check If a Number is Integer in Excel 10.png

The MOD function in Excel is used to return the remainder after dividing one number by another. If a number is divided by 1 and the remainder is 0, then the number is an integer.

3. Check If a Number is Integer with User Defined Function (VBA Code)

You can create a user-defined function in VBA (Visual Basic for Applications) to check if a number is an integer in Excel. Here’s how you can do it:

Step1: Open Excel and press Alt + F11 to open the Visual Basic Editor.

Step2: In the editor, click on Insert > Module to create a new module.

Step3: Type the following code into the module:

How to Check If a Number is Integer in Excel 11.png

Function IsInteger_ExcelHow(ByVal num As Double) As Boolean
    If num = Int(num) Then
        IsInteger_ExcelHow = True
    Else
        IsInteger_ExcelHow = False
    End If
End Function

Step4: Save the module and return to the Excel worksheet.

Step5: In the cell where you want to display the result, enter the formula:

 =IsInteger_ExcelHow(B1)

 where B1 is the cell containing the number you want to check.

How to Check If a Number is Integer in Excel 12.png

If the number in cell B1 is an integer, the formula will return TRUE. If it is not an integer, the formula will return FALSE.

4. Video: Check If Cell Value is Integer

This video will guide you how to check if a number is integer in Cells in Excel with different methods.

  • Excel INT function
    The Excel INT function returns the integer portion of a given number. And it will rounds a given number down to the nearest integer.The syntax of the INT function is as below:= INT (number)…

Понравилась статья? Поделить с друзьями:
  • Check the words in bold in the texts in the word list
  • Check if is date excel
  • Check the verbs in the word list use them in their correct form
  • Check if function in excel
  • Check the verbs below in the word list use them in the correct