The ISBLANK Function tests if a cell is completely blank or not. It returns TRUE if the cell is blank, FALSE otherwise.
=ISBLANK(A2)
Notice cell A5 appears to be blank, but it actually contains “” and thus returns false. We discuss this in the next section.
The ISBLANK Function will return FALSE for cells that look blank, but are not. Including:
By using the IF and OR functions you can identify cells with empty strings as well as normal blank cells.
=IF(OR(ISBLANK(A2),A2=""),"blank","not blank")
=IF(OR(A2=" ", LEN(TRIM(A2))=0), "blank", "not blank")
Often, you’ll want to combine an “IS” function, like ISBLANK, 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 blank or not.
=IF(ISBLANK(C2),"",C2*D2)
With the NOT Function, you can test the inverse: is a cell not blank?
=IF(NOT(ISBLANK(C2)),C2*D2,"")
To test a range for blank values, you could use the ISBLANK Function along with the SUMPRODUCT Function. However, the easiest way to test for blank cells is with the COUNTBLANK Function.
The COUNTBLANK Function counts the number of blank cells in a range.
=COUNTBLANK(A2:C7)
If COUNTBLANK > 0 then there is at least one blank cell in the range. Use this along with an IF Statement to do something if a blank cell is found.
=IF(COUNTBLANK(A2:C2)>0,100*SUM(A2:C2),200*SUM(A2:C2))
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 |
The ISBLANK Function works exactly the same in Google Sheets as in Excel: