Excel for Microsoft 365 Excel for Microsoft 365 for Mac Excel 2021 Excel 2021 for Mac Excel 2019 Excel 2019 for Mac Excel 2016 Excel 2016 for Mac Excel 2013 Excel 2010 Excel 2007 Excel for Mac 2011 More…Less
Sometimes you need to check if a cell is blank, generally because you might not want a formula to display a result without input.
In this case we’re using IF with the ISBLANK function:
-
=IF(ISBLANK(D2),»Blank»,»Not Blank»)
Which says IF(D2 is blank, then return «Blank», otherwise return «Not Blank»). You could just as easily use your own formula for the «Not Blank» condition as well. In the next example we’re using «» instead of ISBLANK. The «» essentially means «nothing».
=IF(D3=»»,»Blank»,»Not Blank»)
This formula says IF(D3 is nothing, then return «Blank», otherwise «Not Blank»). Here is an example of a very common method of using «» to prevent a formula from calculating if a dependent cell is blank:
-
=IF(D3=»»,»»,YourFormula())
IF(D3 is nothing, then return nothing, otherwise calculate your formula).
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.
Explanation
In this example, the goal is to create a formula that will return «Done» in column E when a cell in column D contains a value. In other words, if the cell in column D is «not blank», then the formula should return «Done». In the worksheet shown, column D is is used to record the date a task was completed. Therefore, if the column contains a date (i.e. is not blank), we can assume the task is complete. This problem can be solved with the IF function alone or with the IF function and the ISBLANK function. It can also be solved with the LEN function. All three approaches are explained below.
IF function
The IF function runs a logical test and returns one value for a TRUE result, and another value for a FALSE result. You can use IF to test for a blank cell like this:
=IF(A1="",TRUE) // IF A1 is blank
=IF(A1<>"",TRUE) // IF A1 is not blank
In the first example, we test if A1 is empty with =»». In the second example, the <> symbol is a logical operator that means «not equal to», so the expression A1<>»» means A1 is «not empty». In the worksheet shown, we use the second idea in cell E5 like this:
=IF(D5<>"","Done","")
If D5 is «not empty», the result is «Done». If D5 is empty, IF returns an empty string («») which displays as nothing. As the formula is copied down, it returns «Done» only when a cell in column D contains a value. To display both «Done» and «Not done», you can adjust the formula like this:
=IF(D5<>"","Done","Not done")
ISBLANK function
Another way to solve this problem is with the ISBLANK function. The ISBLANK function returns TRUE when a cell is empty and FALSE if not. To use ISBLANK directly, you can rewrite the formula like this:
=IF(ISBLANK(D5),"","Done")
Notice the TRUE and FALSE results have been swapped. The logic now is if cell D5 is blank. To maintain the original logic, you can nest ISBLANK inside the NOT function like this:
=IF(NOT(ISBLANK(D5)),"Done","")
The NOT function simply reverses the result returned by ISBLANK.
LEN function
One problem with testing for blank cells in Excel is that ISBLANK(A1) or A1=»» will both return FALSE if A1 contains a formula that returns an empty string. In other words, if a formula returns an empty string in a cell, Excel interprets the cell as «not empty». To work around this problem, you can use the LEN function to test for characters in a cell like this:
=IF(LEN(A1)>0,TRUE)
This is a much more literal formula. We are not asking Excel if A1 is blank, we are literally counting the characters in A1. The LEN function will return a positive number only when a cell contains actual characters.
EXCEL FORMULA 1. If a cell is not blank using the IF function
EXCEL
Hard coded formula
Cell reference formula
GENERIC FORMULA =IF(cell_ref<>»», value_if_true, value_if_false) ARGUMENTS GENERIC FORMULA =IF(cell_ref<>»», value_if_true, value_if_false) ARGUMENTS EXPLANATION This formula uses the IF function with a test criteria of two double quotation marks («»), without any value inserted between them and ‘does not equal to’ sign (<>) in front of them, to assess if a cell is not empty and return a specific value. The expression <>»» means «not empty». If a cell is not blank the formula will return a value that has been assigned as the true value, alternatively if a cell is blank the formula will return a value assigned as the false value. With this formula you can enter the values, that will be returned if the cell is empty or not, directly into the formula or reference them to specific cells that capture these values. Click on either the Hard Coded or Cell Reference button to view the formula that has the return values directly entered into the formula or referenced to specific cells that capture these values, respectively. In this example the formula tests if a specific cell is not blank. If the cell is not blank the formula will return a value of «Yes» (hard coded example) or value in cell C5 (cell reference example). If the cell is empty the formula will return a value of «No» (hard coded example) or value in cell C6 (cell reference example). If you are using the formula with values entered directly in the formula and want to return a numerical value, instead of a text value, you do not need to apply the double quotation marks around the values that are to be returned e.g. (=IF(C5<>»»,1,0)). |
EXCEL FORMULA 2. If a cell is not blank using the IF, NOT and ISBLANK functions
EXCEL
Hard coded formula
Cell reference formula
GENERIC FORMULA =IF(NOT(ISBLANK(cell_ref)), value_if_true, value_if_false) ARGUMENTS GENERIC FORMULA =IF(NOT(ISBLANK(cell_ref)), value_if_true, value_if_false) ARGUMENTS EXPLANATION This formula uses a combination of the IF, NOT and ISBLANK functions to assess if a cell is not blank and return a specific value. Unlike the first formula, which uses the double quotation marks («») to test if the selected cell is not blank, this formula uses the NOT and ISBLANK functions. If the cell is not blank the ISBLANK function will return FALSE, alternatively it will return TRUE. The NOT function will then return the opposite to what the ISBLANK function has returned. Therefore, if the cell is not blank the combination of the NOT and ISBLANK function will return a TRUE value. The formula will then return a value that has been assigned as the true value, alternatively if the cell is blank the formula will return a value assigned as the false value. With this formula you can enter the values, that will be returned if the cell is empty or not, directly into the formula or reference them to specific cells that capture these values. Click on either the Hard Coded or Cell Reference button to view the formula that has the return values directly entered into the formula or referenced to specific cells that capture these values, respectively. In this example the formula tests if a specific cell is not blank. If the cell is not blank the formula will return a value of «Yes» (hard coded example) or value in cell C5 (cell reference example). If the cell is empty the formula will return a value of «No» (hard coded example) or value in cell C6 (cell reference example). If you are using the formula with values entered directly in the formula and want to return a numerical value, instead of a text value, you do not need to apply the double quotation marks around the values that are to be returned e.g. (=IF(NOT(ISBLANK(C5)),1,0)). |
VBA CODE 1. If a cell is not blank using the If Statement
VBA
Hard coded against single cell
Sub If_a_cell_is_not_blank()
Dim ws As Worksheet
Set ws = Worksheets(«Analysis»)
If ws.Range(«C5») <> «» Then
ws.Range(«D5») = «Yes»
Else
ws.Range(«D5») = «No»
End If
End Sub
Cell reference against single cell
Sub If_a_cell_is_not_blank()
Dim ws As Worksheet
Set ws = Worksheets(«Analysis»)
If ws.Range(«C9») <> «» Then
ws.Range(«D9») = ws.Range(«C5»)
Else
ws.Range(«D9») = ws.Range(«C6»)
End If
End Sub
Hard coded against range of cells
Sub If_a_cell_is_not_blank()
Dim ws As Worksheet
Set ws = Worksheets(«Analysis»)
For x = 5 To 11
If ws.Cells(x, 3) <> «» Then
ws.Cells(x, 4) = «Yes»
Else
ws.Cells(x, 4) = «No»
End If
Next x
End Sub
Cell reference against range of cells
Sub If_a_cell_is_not_blank()
Dim ws As Worksheet
Set ws = Worksheets(«Analysis»)
For x = 9 To 15
If ws.Cells(x, 3) <> «» Then
ws.Cells(x, 4) = ws.Range(«C5»)
Else
ws.Cells(x, 4) = ws.Range(«C6»)
End If
Next x
End Sub
KEY PARAMETERS
Output Range: Select the output range by changing the cell reference («D5») in the VBA code.
Cell to Test: Select the cell that you want to check if it’s not blank by changing the cell reference («C5») in the VBA code.
Worksheet Selection: Select the worksheet which captures the cells that you want to test if they are not blank and return a specific value by changing the Analysis worksheet name in the VBA code. You can also change the name of this object variable, by changing the name ‘ws’ in the VBA code.
True and False Results: In this example if a cell is not blank the VBA code will return a value of «Yes». If a cell is blank the VBA code will return a value of «No». Both of these values can be changed to whatever value you desire by directly changing them in the VBA code.
NOTES
Note 1: If the cell that is being tested is returning a value of («») this VBA code will identify the cell as blank.
Note 2: If your True or False result is a text value it will need to be captured within quotation marks («»). However, if the result is a numeric value, you can enter it without the use of quotation marks.
KEY PARAMETERS
Output Range: Select the output range by changing the cell reference («D9») in the VBA code.
Cell to Test: Select the cell that you want to check if it’s not blank by changing the cell reference («C9») in the VBA code.
Worksheet Selection: Select the worksheet which captures the cells that you want to test if they are not blank and return a specific value by changing the Analysis worksheet name in the VBA code. You can also change the name of this object variable, by changing the name ‘ws’ in the VBA code.
True and False Results: In this example if a cell is not blank the VBA code will return a value stored in cell C5. If a cell is blank the VBA code will return a value stored in cell C6. Both of these values can be changed to whatever value you desire by either referencing to a different cell that captures the value that you want to return or change the values in those cells.
NOTES
Note 1: If the cell that is being tested is returning a value of («») this VBA code will identify the cell as blank.
KEY PARAMETERS
Output and Test Range: Select the output rows and the rows that captures the cells that are to be tested by changing the x values (5 to 11). This example assumes that both the output and the associated test cell will be in the same row.
Test Column: Select the column that captures the cells that are to be tested by changing number 3, in ws.Cells(x, 3).
Output Column: Select the output column by changing number 4, in ws.Cells(x, 4).
Worksheet Selection: Select the worksheet which captures the cells that you want to test if they are not blank and return a specific value by changing the Analysis worksheet name in the VBA code. You can also change the name of this object variable, by changing the name ‘ws’ in the VBA code.
True and False Results: In this example if a cell is not blank the VBA code will return a value of «Yes». If a cell is blank the VBA code will return a value of «No». Both of these values can be changed to whatever value you desire by directly changing them in the VBA code.
NOTES
Note 1: If the cell that is being tested is returning a value of («») this VBA code will identify the cell as blank.
Note 2: If your True or False result is a text value it will need to be captured within quotation marks («»). However, if the result is a numeric value, you can enter it without the use of quotation marks.
KEY PARAMETERS
Output and Test Range: Select the output rows and the rows that captures the cells that are to be tested by changing the x values (9 to 15). This example assumes that both the output and the associated test cell will be in the same row.
Test Column: Select the column that captures the cells that are to be tested by changing number 3, in ws.Cells(x, 3).
Output Column: Select the output column by changing number 4, in ws.Cells(x, 4).
Worksheet Selection: Select the worksheet which captures the cells that you want to test if they are not blank and return a specific value by changing the Analysis worksheet name in the VBA code. You can also change the name of this object variable, by changing the name ‘ws’ in the VBA code.
True and False Results: In this example if a cell is not blank the VBA code will return a value stored in cell C5. If a cell is blank the VBA code will return a value stored in cell C6. Both of these values can be changed to whatever value you desire by either referencing to a different cell that captures the value that you want to return or change the values in those cells.
NOTES
Note 1: If the cell that is being tested is returning a value of («») this VBA code will identify the cell as blank.
VBA CODE 2. If a cell is not blank using Not and IsEmpty
VBA
Hard coded against single cell
Sub If_a_cell_is_not_blank_using_Not_and_IsEmpty()
Dim ws As Worksheet
Set ws = Worksheets(«Analysis»)
If Not (IsEmpty(ws.Range(«C5»)))Then
ws.Range(«D5») = «Yes»
Else
ws.Range(«D5») = «No»
End If
End Sub
Cell reference against single cell
Sub If_a_cell_is_not_blank_using_Not_and_IsEmpty()
Dim ws As Worksheet
Set ws = Worksheets(«Analysis»)
If Not (IsEmpty(ws.Range(«C9»)))Then
ws.Range(«D9») = ws.Range(«C5»)
Else
ws.Range(«D9») = ws.Range(«C6»)
End If
End Sub
Hard coded against range of cells
Sub If_a_cell_is_not_blank_using_Not_and_IsEmpty()
Dim ws As Worksheet
Set ws = Worksheets(«Analysis»)
For x = 5 To 11
If Not (IsEmpty(ws.Cells(x, 3))) Then
ws.Cells(x, 4) = «Yes»
Else
ws.Cells(x, 4) = «No»
End If
Next x
End Sub
Cell reference against range of cells
Sub If_a_cell_is_not_blank_using_Not_and_IsEmpty()
Dim ws As Worksheet
Set ws = Worksheets(«Analysis»)
For x = 9 To 15
If Not (IsEmpty(ws.Cells(x, 3))) Then
ws.Cells(x, 4) = ws.Range(«C5»)
Else
ws.Cells(x, 4) = ws.Range(«C6»)
End If
Next x
End Sub
KEY PARAMETERS
Output Range: Select the output range by changing the cell reference («D5») in the VBA code.
Cell to Test: Select the cell that you want to check if it’s not blank by changing the cell reference («C5») in the VBA code.
Worksheet Selection: Select the worksheet which captures the cells that you want to test if they are not blank and return a specific value by changing the Analysis worksheet name in the VBA code. You can also change the name of this object variable, by changing the name ‘ws’ in the VBA code.
True and False Results: In this example if a cell is not blank the VBA code will return a value of «Yes». If a cell is blank the VBA code will return a value of «No». Both of these values can be changed to whatever value you desire by directly changing them in the VBA code.
NOTES
Note 1: If the cell that is being tested is returning a value of («») this VBA code will identify the cell as not blank.
Note 2: If your True or False result is a text value it will need to be captured within quotation marks («»). However, if the result is a numeric value, you can enter it without the use of quotation marks.
KEY PARAMETERS
Output Range: Select the output range by changing the cell reference («D9») in the VBA code.
Cell to Test: Select the cell that you want to check if it’s not blank by changing the cell reference («C9») in the VBA code.
Worksheet Selection: Select the worksheet which captures the cells that you want to test if they are not blank and return a specific value by changing the Analysis worksheet name in the VBA code. You can also change the name of this object variable, by changing the name ‘ws’ in the VBA code.
True and False Results: In this example if a cell is not blank the VBA code will return a value stored in cell C5. If a cell is blank the VBA code will return a value stored in cell C6. Both of these values can be changed to whatever value you desire by either referencing to a different cell that captures the value that you want to return or change the values in those cells.
NOTES
Note 1: If the cell that is being tested is returning a value of («») this VBA code will identify the cell as not blank.
KEY PARAMETERS
Output and Test Range: Select the output rows and the rows that captures the cells that are to be tested by changing the x values (5 to 11). This example assumes that both the output and the associated test cell will be in the same row.
Test Column: Select the column that captures the cells that are to be tested by changing number 3, in ws.Cells(x, 3).
Output Column: Select the output column by changing number 4, in ws.Cells(x, 4).
Worksheet Selection: Select the worksheet which captures the cells that you want to test if they are not blank and return a specific value by changing the Analysis worksheet name in the VBA code. You can also change the name of this object variable, by changing the name ‘ws’ in the VBA code.
True and False Results: In this example if a cell is not blank the VBA code will return a value of «Yes». If a cell is blank the VBA code will return a value of «No». Both of these values can be changed to whatever value you desire by directly changing them in the VBA code.
NOTES
Note 1: If the cell that is being tested is returning a value of («») this VBA code will identify the cell as blank.
Note 2: If your True or False result is a text value it will need to be captured within quotation marks («»). However, if the result is a numeric value, you can enter it without the use of quotation marks.
KEY PARAMETERS
Output and Test Range: Select the output rows and the rows that captures the cells that are to be tested by changing the x values (9 to 15). This example assumes that both the output and the associated test cell will be in the same row.
Test Column: Select the column that captures the cells that are to be tested by changing number 3, in ws.Cells(x, 3).
Output Column: Select the output column by changing number 4, in ws.Cells(x, 4).
Worksheet Selection: Select the worksheet which captures the cells that you want to test if they are not blank and return a specific value by changing the Analysis worksheet name in the VBA code. You can also change the name of this object variable, by changing the name ‘ws’ in the VBA code.
True and False Results: In this example if a cell is not blank the VBA code will return a value stored in cell C5. If a cell is blank the VBA code will return a value stored in cell C6. Both of these values can be changed to whatever value you desire by either referencing to a different cell that captures the value that you want to return or change the values in those cells.
NOTES
Note 1: If the cell that is being tested is returning a value of («») this VBA code will identify the cell as blank.
VBA CODE 3. If a cell is not blank using vbNullString
VBA
Hard coded against single cell
Sub If_a_cell_is_not_blank_using_vbNullString()
Dim ws As Worksheet
Set ws = Worksheets(«Analysis»)
If ws.Range(«C5») <> vbNullString Then
ws.Range(«D5») = «Yes»
Else
ws.Range(«D5») = «No»
End If
End Sub
Cell reference against single cell
Sub If_a_cell_is_not_blank_using_vbNullString()
Dim ws As Worksheet
Set ws = Worksheets(«Analysis»)
If ws.Range(«C9») <> vbNullString Then
ws.Range(«D9») = ws.Range(«C5»)
Else
ws.Range(«D9») = ws.Range(«C6»)
End If
End Sub
Hard coded against range of cells
Sub If_a_cell_is_not_blank_using_vbNullString()
Dim ws As Worksheet
Set ws = Worksheets(«Analysis»)
For x = 5 To 11
If ws.Cells(x, 3) <> vbNullString Then
ws.Cells(x, 4) = «Yes»
Else
ws.Cells(x, 4) = «No»
End If
Next x
End Sub
Cell reference against range of cells
Sub If_a_cell_is_not_blank_using_vbNullString()
Dim ws As Worksheet
Set ws = Worksheets(«Analysis»)
For x = 9 To 15
If ws.Cells(x, 3) <> vbNullString Then
ws.Cells(x, 4) = ws.Range(«C5»)
Else
ws.Cells(x, 4) = ws.Range(«C6»)
End If
Next x
End Sub
KEY PARAMETERS
Output Range: Select the output range by changing the cell reference («D5») in the VBA code.
Cell to Test: Select the cell that you want to check if it’s not blank by changing the cell reference («C5») in the VBA code.
Worksheet Selection: Select the worksheet which captures the cells that you want to test if they are not blank and return a specific value by changing the Analysis worksheet name in the VBA code. You can also change the name of this object variable, by changing the name ‘ws’ in the VBA code.
True and False Results: In this example if a cell is not blank the VBA code will return a value of «Yes». If a cell is blank the VBA code will return a value of «No». Both of these values can be changed to whatever value you desire by directly changing them in the VBA code.
NOTES
Note 1: If the cell that is being tested is returning a value of («») this VBA code will identify the cell as blank.
Note 2: If your True or False result is a text value it will need to be captured within quotation marks («»). However, if the result is a numeric value, you can enter it without the use of quotation marks.
KEY PARAMETERS
Output Range: Select the output range by changing the cell reference («D9») in the VBA code.
Cell to Test: Select the cell that you want to check if it’s not blank by changing the cell reference («C9») in the VBA code.
Worksheet Selection: Select the worksheet which captures the cells that you want to test if they are not blank and return a specific value by changing the Analysis worksheet name in the VBA code. You can also change the name of this object variable, by changing the name ‘ws’ in the VBA code.
True and False Results: In this example if a cell is not blank the VBA code will return a value stored in cell C5. If a cell is blank the VBA code will return a value stored in cell C6. Both of these values can be changed to whatever value you desire by either referencing to a different cell that captures the value that you want to return or change the values in those cells.
NOTES
Note 1: If the cell that is being tested is returning a value of («») this VBA code will identify the cell as blank.
KEY PARAMETERS
Output and Test Rows: Select the output rows and the rows that captures the cells that are to be tested by changing the x values (5 to 11). This example assumes that both the output and the associated test cell will be in the same row.
Test Column: Select the column that captures the cells that are to be tested by changing number 3, in ws.Cells(x, 3).
Output Column: Select the output column by changing number 4, in ws.Cells(x, 4).
Worksheet Selection: Select the worksheet which captures the cells that you want to test if they are not blank and return a specific value by changing the Analysis worksheet name in the VBA code. You can also change the name of this object variable, by changing the name ‘ws’ in the VBA code.
True and False Results: In this example if a cell is not blank the VBA code will return a value of «Yes». If a cell is blank the VBA code will return a value of «No». Both of these values can be changed to whatever value you desire by directly changing them in the VBA code.
NOTES
Note 1: If the cell that is being tested is returning a value of («») this VBA code will identify the cell as blank.
Note 2: If your True or False result is a text value it will need to be captured within quotation marks («»). However, if the result is a numeric value, you can enter it without the use of quotation marks.
KEY PARAMETERS
Output and Test Rows: Select the output rows and the rows that captures the cells that are to be tested by changing the x values (9 to 15). This example assumes that both the output and the associated test cell will be in the same row.
Test Column: Select the column that captures the cells that are to be tested by changing number 3, in ws.Cells(x, 3).
Output Column: Select the output column by changing number 4, in ws.Cells(x, 4).
Worksheet Selection: Select the worksheet which captures the cells that you want to test if they are not blank and return a specific value by changing the Analysis worksheet name in the VBA code. You can also change the name of this object variable, by changing the name ‘ws’ in the VBA code.
True and False Results: In this example if a cell is not blank the VBA code will return a value stored in cell C5. If a cell is blank the VBA code will return a value stored in cell C6. Both of these values can be changed to whatever value you desire by either referencing to a different cell that captures the value that you want to return or change the values in those cells.
NOTES
Note 1: If the cell that is being tested is returning a value of («») this VBA code will identify the cell as blank.
We can determine if a cell is not blank in Excel by either using the IF function or by using the IF and ISBLANK function combined. This tutorial will assist all levels of Excel users in both methods to identify non-blank cells
Figure 1. Final result: Determine if a cell is not blank in Excel
IF Function in Excel
IF function evaluates a given logical test and returns a TRUE or a FALSE
Syntax
=IF(logical_test, [value_if_true], [value_if_false])
- The arguments “value_if_true” and “value_if_false” are optional. If left blank, the function will return TRUE if the logical test is met, and FALSE if otherwise.
ISBLANK Function in Excel
ISBLANK function is more straightforward. It tests whether a value or a cell is blank or not.
Syntax
=ISBLANK(value)
- The function returns TRUE if the value is blank; FALSE if otherwise
Setting up the Data
Below is a list of Projects and a column for Date Completed. We want to know if column C for the “Date Completed” is blank or not.
Figure 2. Sample data to determine if a cell is not blank
Determine If a Cell is Not Blank
Using the IF function
In cell D3, enter the formula:
=IF(C3<>"","Not blank","Blank")
- The symbol <> in Excel means “not equal to”
- “” in Excel means empty string, or blank
- C3<>”” means C3 is not equal to blank, or C3 is not blank
This formula returns “Not blank” because cell C3 is not blank. It has the value “July 26, 2018”.
Figure 3. Entering the IF formula to determine if a cell is not blank
In cell D4, enter the formula:
=IF(C4<>"","Not blank","Blank")
The result is “Blank” because cell D4 is empty.
Figure 4. Output: Using IF to determine if a cell is not blank
Using the IF and ISBLANK function
In cell D5, enter the formula:
=IF(ISBLANK(C5),"Blank","Not Blank")
- ISBLANK evaluates whether cell C5 is blank or not
- If the ISBLANK function returns TRUE, the formula will return “Blank”; otherwise, it returns “Not Blank”
- The result is “Blank” because C5 is empty
Figure 5. Final result: Using IF and ISBLANK to determine if a cell is not blank
Note
We can customize the action that the IF function will return depending on the logical test results.
Example
We want to return the status “Completed” if the cell in column C is not blank, and “In Progress” if otherwise.
Enter the following formula:
In cell D3: =IF(C3<>"","Completed","In Progress")
In cell D4: =IF(C4<>"","Completed","In Progress")
In cell D5: =IF(ISBLANK(C5),"In Progress","Completed")
In cell D6: =IF(ISBLANK(C6),"In Progress","Completed")
Figure 6. Final result: Using IF and ISBLANK to determine the status of a project
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.
Are you still looking for help with the IF function? View our comprehensive round-up of IF function tutorials here.
If you want to check the value in one cell if it is blank or empty cell, then you can use IF function in combination with ISBLANK function or logical operator (equal to) in excel.
Table of Contents
- Excel IF function check if the cell is blank
- Excel IF function check if the cell is non-blank
- Related Formulas
- Related Functions
Let’s see the generic IF formula with ISBLANK function and Logical operator = as follows:
=IF(ISBLANK(B1),"PASS","FAILED") =IF(B1="","PASS","FAILED")
In the above two IF formulas, it will return “PASS” if Cell B1 is blank, Otherwise returns “FAILED”.
Excel IF function check if the cell is non-blank
If you want to check the value in one cell if it is not blank or not empty cell, then you can use IF function in combination with ISBLANK function or logical operator (not equal to) in excel.
let’s see the generic IF formula with ISBLANK function and Logical operator <> as follows:
=IF(ISBLANK(B1)=FALSE,"PASS","FAILED") =IF(B1<>"","PASS","FAILED")
In the above two IF formulas, it will return “PASS” if Cell B1 is not blank, otherwise returns “FAILED”.
Let’s write a nested if function in combining with AND function and ISBLANK function to achieve the following test criteria.
IF cell A1 is greater than or equal to 10, then add to C1.
If Cell B1 is greather than or equal to 10, then subtract from C1.
If both A1 and b1 are blank cells, then equals to C1.
Based on the above logic, we can write down the following excel nested if formula (statement):
=IF(A1>=0,C1+A1, IF(B1>=0,C1-B1, IF(AND(ISBLANK(A1)=TRUE, ISBLANK(B1)=TRUE),C1,"")))
- Excel IF formula with operator : greater than,less than
Now we can use the above logical test with greater than operator. Let’s see the below generic if formula with greater than operator:=IF(A1>10,”excelhow.net”,”google”) … -
Excel IF function with text values
If you want to write an IF formula for text values in combining with the below two logical operators in excel, such as: “equal to” or “not equal to”… -
Excel IF Function With Numbers
If you want to check if a cell values is between two values or checking for the range of numbers or multiple values in cells, at this time, we need to use AND or OR logical function in combination with the logical operator and IF function… -
Excel IF function with Dates
If you have a list of dates and then want to compare to these dates with a specified date to check if those dates is greater than or less than that specified date. …
- Excel AND function
The Excel AND function returns TRUE if all of arguments are TRUE, and it returns FALSE if any of arguments are FALSE.The syntax of the AND function is as below:= AND (condition1,[condition2],…) … - Excel IF function
The Excel IF function perform a logical test to return one value if the condition is TRUE and return another value if the condition is FALSE…. - Excel nested if function
The nested IF function is formed by multiple if statements within one Excel if function. This excel nested if statement makes it possible for a single formula to take multiple actions… - Excel ISBLANK function
The Excel ISBLANK function returns TRUE if the value is blank or null.The syntax of the ISBLANK function is as below:= ISBLANK (value)…