Excel ISNUMBER Function
The Excel ISNUMBER function tests a specified value (cell) if it's a numeric value and returns TRUE if it's a text value or FALSE if it's not a numeric value
Example: Excel ISNUMBER Function
=ISNUMBER(B5)
|
Result in cell C5 (FALSE) - returns FALSE given cell B5 is a text value.
|
=ISNUMBER(B6)
|
Result in cell C6 (TRUE) - returns TRUE given cell B6 only comprises numeric values.
|
=ISNUMBER(B7)
|
Result in cell C7 (FALSE) - returns FALSE given cell B7 comprises text and numeric values therefore it is treated as text value.
|
=ISNUMBER(B8)
|
Result in cell C8 (FALSE) - returns FALSE given cell B8 is blank and therefore isn't treated as a numeric or a text value.
|
=ISNUMBER(B9)
|
Result in cell C9 (TRUE) - returns TRUE given cell B9 is a date and is treated as a numeric value.
|
METHOD 2. Excel ISNUMBER function using the Excel built-in function library
EXCEL
Formulas tab > Function Library group > More Functions > Information > ISNUMBER > populate the input box
=ISNUMBER(B6) Note: in this example we are populating the Value input box associated with the ISNUMBER function. |
Sub Excel_ISNUMBER_Function()
'declare a variable
Dim ws As Worksheet
Dim ws As Worksheet
Set ws = Worksheets("ISNUMBER")
'apply the Excel ISNUMBER function
ws.Range("C5") = Application.WorksheetFunction.IsNumber(ws.Range("B5"))
ws.Range("C6") = Application.WorksheetFunction.IsNumber(ws.Range("B6"))
ws.Range("C7") = Application.WorksheetFunction.IsNumber(ws.Range("B7"))
ws.Range("C8") = Application.WorksheetFunction.IsNumber(ws.Range("B8"))
ws.Range("C9") = Application.WorksheetFunction.IsNumber(ws.Range("B9"))
ws.Range("C5") = Application.WorksheetFunction.IsNumber(ws.Range("B5"))
ws.Range("C6") = Application.WorksheetFunction.IsNumber(ws.Range("B6"))
ws.Range("C7") = Application.WorksheetFunction.IsNumber(ws.Range("B7"))
ws.Range("C8") = Application.WorksheetFunction.IsNumber(ws.Range("B8"))
ws.Range("C9") = Application.WorksheetFunction.IsNumber(ws.Range("B9"))
End Sub
OBJECTS
Worksheets: The Worksheets object represents all of the worksheets in a workbook, excluding chart sheets.
Range: The Range object is a representation of a single cell or a range of cells in a worksheet.
Worksheets: The Worksheets object represents all of the worksheets in a workbook, excluding chart sheets.
Range: The Range object is a representation of a single cell or a range of cells in a worksheet.
PREREQUISITES
Worksheet Name: Have a worksheet named ISNUMBER.
Worksheet Name: Have a worksheet named ISNUMBER.
ADJUSTABLE PARAMETERS
Output Range: Select the output range by changing the cell references ("C5") through to ("C9") in the VBA code to any cell in the worksheet, that doesn't conflict with the formula.
METHOD 2. Excel ISNUMBER function using VBA with a For Loop
VBA
Sub Excel_ISNUMBER_Function()
'declare a variable
Dim ws As Worksheet
Dim ws As Worksheet
Set ws = Worksheets("ISNUMBER")
'apply the Excel ISNUMBER function
For x = 5 To 9
For x = 5 To 9
On Error Resume Next
ws.Cells(x, 3) = Application.WorksheetFunction.IsNumber(ws.Cells(x, 2))
Next
End Sub
OBJECTS
Worksheets: The Worksheets object represents all of the worksheets in a workbook, excluding chart sheets.
Range: The Range object is a representation of a single cell or a range of cells in a worksheet.
Worksheets: The Worksheets object represents all of the worksheets in a workbook, excluding chart sheets.
Range: The Range object is a representation of a single cell or a range of cells in a worksheet.
PREREQUISITES
Worksheet Name: Have a worksheet named ISNUMBER.
Worksheet Name: Have a worksheet named ISNUMBER.
ADJUSTABLE PARAMETERS
Output Ranges: Select the output ranges by changing the For x values (5 to 9).
Output Range: Select the output column by changing the column number.
DESCRIPTION
The Excel ISNUMBER function tests a specified value (cell) if it's a numeric value. If the cell is a numeric value the Excel ISNUMBER function will return TRUE. Alternatively, if the cell is not a numeric value the Excel ISNUMBER function will return FALSE.
The Excel ISNUMBER function tests a specified value (cell) if it's a numeric value. If the cell is a numeric value the Excel ISNUMBER function will return TRUE. Alternatively, if the cell is not a numeric value the Excel ISNUMBER function will return FALSE.
SYNTAX
=ISNUMBER(value)
=ISNUMBER(value)
ARGUMENTS
value: (Required) The value that is to be tested.