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.
The logical expression =»» means «is empty». In the example shown, column D contains a date if a task has been completed. In column E, a formula checks for blank cells in column D. If a cell is blank, the result is a status of «Open». If the cell contains value (a date in this case, but it could be any value) the formula returns «Closed».
The effect of showing «Closed» in light gray is accomplished with a conditional formatting rule.
Display nothing if cell is blank
To display nothing if a cell is blank, you can replace the «value if false» argument in the IF function with an empty string («») like this:
=IF(D5="","","Closed")
Alternative with ISBLANK
Excel contains a function made to test for blank cells called ISBLANK. To use the ISBLANK, you can revise the formula as follows:
=IF(ISBLANK(D5),"Open","Closed")
Home / Excel Formulas / IF Cell is Blank (Empty) using IF + ISBLANK
In Excel, if you want to check if a cell is blank or not, you can use a combination formula of IF and ISBLANK. These two formulas work in a way where ISBLANK checks for the cell value and then IF returns a meaningful full message (specified by you) in return.
In the following example, you have a list of numbers where you have a few cells blank.
Formula to Check IF a Cell is Blank or Not (Empty)
- First, in cell B1, enter IF in the cell.
- Now, in the first argument, enter the ISBLANK and refer to cell A1 and enter the closing parentheses.
- Next, in the second argument, use the “Blank” value.
- After that, in the third argument, use “Non-Blank”.
- In the end, close the function, hit enter, and drag the formula up to the last value that you have in the list.
As you can see, we have the value “Blank” for the cell where the cell is empty in column A.
=IF(ISBLANK(A1),"Blank","Non-Blank")
Now let’s understand this formula. In the first part where we have the ISBLANK which checks if the cells are blank or not.
And, after that, if the value returned by the ISBLANK is TRUE, IF will return “Blank”, and if the value returned by the ISBLANK is FALSE IF will return “Non_Blank”.
Alternate Formula
You can also use an alternate formula where you just need to use the IF function. Now in the function, you just need to specify the cell where you want to test the condition and then use an equal operator with the blank value to create a condition to test.
And you just need to specify two values that you want to get the condition TRUE or FALSE.
Download Sample File
- Ready
And, if you want to Get Smarter than Your Colleagues check out these FREE COURSES to Learn Excel, Excel Skills, and Excel Tips and Tricks.
Looking for coding that checks if cell is empty or not. If it is not empty then move to the next cell group. But I need to check if the next cell group is empty or not. If not, then move to the next and so on.
My Current coding below.
If IsEmpty(ActiveSheet.Range("h3")) Then
Do
Checkbox1.Value = True
Range("H3") = 17002
Sheets("Sheet1").Range("I3") = Printerformat2.Text
Else
Checkbox1.Value = True
Range("l3") = 17002
Sheets("Sheet1").Range("m3") = Printerformat2.Text
End If
asked Aug 12, 2011 at 15:37
2
You need to use a for loop to iterate through the specified range in «H»
Dim i As Long
With ActiveSheet
For i = 1 to 500
If IsEmpty(.Range("h" & CStr(i)).Value) Then
'Do 'Not sure where you're going with this one? This is not really needed from what I can tell.
Checkbox1.Value = True
.Range("H" & CStr(i)).Value = 17002
Sheets("Sheet1").Range("I" & CStr(i)).Value = Printerformat2.Text
Else
Checkbox1.Value = True
.Range("l" & CStr(i)) = 17002
Sheets("Sheet1").Range("m" & CStr(i)).value = Printerformat2.Text
End If
Next
End With
Hope that helps?
answered Aug 13, 2011 at 1:23
2
I think you should have a look at Range("your range").specialcells(xlCellTypeBlanks)
. This is the fastest way to loop through empty cells.
If you need to loop on non blank cells, you can check if your cell Intersect
the empty cells range.
answered Aug 13, 2011 at 18:15
iDevlopiDevlop
24.6k11 gold badges89 silver badges147 bronze badges
The most optimized way to make sure a cell is not empty is «If Len(cell) <> 0».
You can use .offset to access another cell in relation to it’s position from the current cell, or reference it directly, so you can check if it’s empty or not.
answered Aug 13, 2011 at 13:46
GaijinhunterGaijinhunter
14.5k4 gold badges50 silver badges57 bronze badges
Use
Application.WorksheetFunction.isblank(ActiveSheet.range("h3"))
instead of
IsEmpty(ActiveSheet.Range("h3"))
Cordially
answered Aug 3, 2012 at 9:43
MUY BelgiumMUY Belgium
2,2624 gold badges30 silver badges44 bronze badges
0
How to check if a cell is empty or is not empty in Excel; this tutorial shows you a couple different ways to do this.
Sections:
Check if a Cell is Empty or Not — Method 1
Check if a Cell is Empty or Not — Method 2
Notes
Check if a Cell is Empty or Not — Method 1
Use the ISBLANK() function.
This will return TRUE if the cell is empty or FALSE if the cell is not empty.
Here, cell A1 is being checked, which is empty.
When the cell is not empty, it looks like this:
FALSE is output because cell B1 is not empty.
Reverse the True/False Output
Some formulas need to have TRUE or FALSE reversed in order to work correctly; to do this, use the NOT() function.
Result:
Whereas ISBLANK() output a TRUE for cell A1, the NOT() function reversed that and changed it to FALSE.
The same works for changing FALSE to TRUE.
Check if a Cell is Empty or Not — Method 2
You can also use an IF statement to check if a cell is empty.
=IF(A1="","Empty","Not Empty")
Result:
The function checks if this part is true: A1=»» which checks if A1 is equal to nothing.
When there is something in the cell, it works like this:
Cell B1 is not empty so we get a Not Empty result.
In this example I set the IF statement to output «Empty» or «Not Empty» but you can change it to whatever you like.
Reverse the Check
The example above checked if the cell was empty, but you can also check if the cell is not empty.
There are a few different ways to do this, but I will show you a simple and easy method here.
=IF(A1<>"","Not Empty","Empty")
Notice the check this time is A1<>»» and that says «is cell A1 not equal to nothing.» It sounds confusing but just remember that <> is basically the reverse of =.
I also had to switch the «Empty» and «Not Empty» in order to get the correct result since we are now checking if the cell is not empty.
Result:
As you can see, it outputs the same result as the previous example, just like it should.
Using <> instead of = merely reverses it, making a TRUE become a FALSE and a FALSE become a TRUE, which is why «Empty» and «Not Empty» had to be reversed in order to still output the correct result.
Notes
It may seem useless to return TRUE or FALSE like in the first method, but remember that many functions in Excel, including IF(), AND(), and OR() all rely on results that are either TRUE or FALSE.
Checking for blanks and returning TRUE or FALSE is a simple concept but it can get a bit confusing in Excel, especially when you have complex formulas that rely on the result of the formulas in this tutorial. Save this tutorial and work with the attached sample file and you will have it down in no time.
Make sure to download the attached sample file to work with these examples in Excel.
Similar Content on TeachExcel
Excel VBA Check if a Cell is in a Range
Tutorial: VBA that checks if a cell is in a range, named range, or any kind of range, in Excel.
Sec…
Make Complex Formulas for Conditional Formatting in Excel
Tutorial: How to make complex formulas for conditional formatting rules in Excel. This will serve as…
Sort Data Alphabetically or Numerically in Excel 2007 and Later
Tutorial: This Excel tip shows you how to Sort Data Alphabetically and Numerically in Excel 2007. T…
Filter Data to Display the Results that Begin With Specified Text or Words in Excel — AutoFilter
Macro: This Excel macro automatically filters a set of data based on the words or text that are c…
Odd or Even Row Formulas in Excel
Tutorial: Formulas to determine if the current cell is odd or even; this allows you to perform speci…
Formula to Count Occurrences of a Word in a Cell or Range in Excel
Tutorial: Formula to count how many times a word appears in a single cell or an entire range in Exce…