# If Cell is Blank

IF function is frequently used in Excel worksheet to return you expect “true value” or “false value” based on the result of created logical test. If you want to see if a cell is blank or not, and leave some comments for blank cells, you can build a formula with IF function, IF function can return “value if blank” or “value if not blank” based on test “if cell is blank”. ## FORMULA

To test if cell equals a certain text string, the generic formula is:

=IF(A1=””,”blank value”,”not blank value”)

Formula in this example:

=IF(B4=””,”Fail the exam!”,””)

## EXPLANATION

In this example, for a student, if cell in “Grade” column is blank, that means he/she failed the exam, and we want to add comment “Fail the exam!” in C column for those students who fail the exam. To return proper value based on “if cell is blank or not”, IF function can handle this case effectively.

IF function allows you to create a logical comparison between your value and reference value (for example “A1>0”), and set true value and false value what you expect to return as test results. IF function returns one of the two results based on logical comparison result.

Syntax: IF(logica_test,[value_if_true],[value_if_false])

To test if B4 is blank, we can directly create a logical comparison B4=“”, “” represents “Empty”, there is no need to add an extra space between “”, but double quotes “” should not be ignored. If missing double quotes, Excel will prompts warning message that the formula you typed contains an error, if you ignore the error, #VALUE! is displayed in cell.

In this example, B4 is not a blank cell, logical test B4=”” returns false to IF functon. As the result is false, IF function retrieves the value from “value if false” argument, in this case it is empty string, so nothing displays in C5. But for B7, B7 is a blank cell, it meets the condition “B7=”””, so IF retrieves true value “Fail the exam!” and return it to C7.

In IF, true value and false value can be set as empty string “”, a text, a number or a formula, you can set what you expect to these two values.

## ISBLANK Function

You can also use ISBLANK function to test if a cell is blank or not. In the formula, we can use ISBLANK(B4) to replace original logical test “B4=”””. ### Related Functions

• 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)…
• 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. The IF function is a build-in function in Microsoft Excel and it is categorized as a Logical Function.The syntax of the IF function is as below:= IF (condition, [true_value], [false_value])….
Related Posts

Calculate Days Open in Excel

If you want to know how to Calculate days in Excel, there are some formulas that you can use to do so. For example, you can use the DAYS function in Excel to find the number of days between two ...

Add Row Numbers And Skip Blanks in Excel

Do you ever have to input a list of numbers into a spreadsheet, and some of the cells are blank? It can be difficult to keep track of what number is in which cell when you have to scroll up ...

Check If a Cell is Blank or Empty

The article demonstrates how to check if a range of cells is blank or empty by ISBLANK and other functions to recognize empty cells in Excel and take appropriate action based on their status. There are several circumstances in which ...

If Value is Greater Than A Certain Value

IF function is frequently used in Excel worksheet to return you expect “true value” or “false value” based on the logical test result. If you want to see if a value in one cell is greater than a specific value, ...

If Cell is Not Blank

IF function is frequently used in Excel worksheet to return you expect “true value” or “false value” based on the result of created logical test. If you want to see if a cell is blank or not, and leave some ...

If Cell Equals Certain Text String

IF function is frequently used in Excel worksheet to return you expect “true value” or “false value” based on the result of created logical test. If you want to see if cell equals a certain text string like “Win”, you ...

If Cell Contains Either Text1 or Text2

IF function is frequently used in Excel worksheet to return “true value” or “false value” based on the logical test result. If you want to see if cell contains certain substring1 like “abc” or substring2 like “def”, and returns true ...

If Cell Contains Certain Text OR Equals Certain Text

IF cell equals certain text IF function is frequently used in Excel worksheet to return “true value” or “false value” based on the logical test result. If you want to test values to see if they equal certain text like ...

Fix #N/A Error For VLOOKUP From Another Sheet

This post will show you how to fix the #N/A error why it occurs when you extract values from another sheet using VLOOKUP function in Excel 2016,2013,2010 or other Excel versions. How can you correct a #N/A error in VLOOKUP ...

How to Average Only Positive or Negative Numbers of a Range

Suppose both positive numbers and negative numbers exist in a table. If we want to know the average of only positive numbers in this table, we can create a formula to get average of all positive numbers with all negative ...

Sidebar