Excel IF Function | A Great Way To Determine A Blank Cell

Using Excel as a To-Do list gatherer is a boon. Take an example of yesterday, My Colleague enlisted his weekly task on a spreadsheet. Trust me, the list was huge!

He was manually striking through the contents because he didn’t know which tasks were undone.

So, I thought, why not create a tutorial on how to check if a cell is blank or not?

how-to-use-if-function-if-cell-is-not-blank

Syntax of IF Function

=IF(logical_test, [value_if_true], [value_if_false])

The IF Function is called the logical function. We use the IF formulas when we come across a situation that ends with either TRUE or FALSE.

We sure can use the ISBLANK function to determine which cells are empty. But, in this tutorial, let’s get to know how we can use the IF function in this case.

How to Not Calculate (Ignore formula) if a cell is blank in Excel?

Let’s assume I am creating a database of my employees where I want to find out their respective ages. In that case, I need the data of their birthdates.

I used the TODAY Function to get their ages. And then divided the result by 365 because 1 year = 365 days. The following formula is as follows:

=(TODAY()-B2)/365

But there was a problem. An employee didn’t enter the date of birth and that’s why Excel is returning an absurd result.

So, I want to ignore the formula in blank cells and count values if the cell is not blank. I will combine the IF Function with the TODAY Function.

Here’s how the formula looks like:

=IF(B2<>””,(TODAY()-B2)/365,””)

Result: The blank cells are skipped and Excel considers only the cells containing contents.

Explanation of the Formula:

The symbol <> means not equal to. So, the formula states that, If the cell B2 is not blank, then show the result of the next argument. If the cell B2 is blank, then leave the cell empty.

Highlight Tasks Based on a Cell that is Not Blank

We will use conditional formatting to highlight tasks based on occupied cells. Let’s strike through the tasks that were already done in the To-Do list and highlight it in green.

to-do-list-excel

Select the range of cells you want to format (in our case, its D2:D6). Select Conditional Formatting from the Home Tab. Create a new formatting rule.

For Mac

Select the Classic Style after the New Formatting Rule Tab opens. From the drop-down menu, use a formula to determine which cells to format. Enter the formula below in the empty box.

=IF($D2<>””, TRUE, FALSE)

conditional-formatting-rule-mac

Click on the Format With Button and select Customized Format. Go to the Fill Tab and set the background color to green.

fill-background-color-to-green

Now, go to the Font Tab and Optimize the following options.

Font Style = Regular

Effects = Strikethrough

format-font-styles-excel-conditional-formatting-mac

Click on the OK button and preview the dialog box. Select OK to apply the new formatting rule.

highlight-and-strikethrough-text-with-if-function

Explanation of the Formula:

The formula works with the IF Function. Inside the logical_test argument, an absolute cell reference $D2 is set. The <> symbol means not equal to. So, if the cell D2 is not equal to blank then the value will be considered TRUE. Otherwise, FALSE.

Conditional Formatting helped in highlighting those particular cells that follow the command we created. Additionally, it also strikes through texts that satisfy the provided command.

FAQ

Q: How to check if a cell isn’t blank in Excel?

A: Use the ISBLANK Function to check whether a cell is blank or not. The ISBLANK Function also works great when combined with the IF function. For Example: =IF(ISBLANK(D2),”Blank”,”Not Blank”).

Q: What is <> in Excel?

A: The symbol <> is similar to not equal to in Excel. You can insert the not equal to (≠) symbol in your spreadsheets, but it won’t work. Whenever Excel sees the “does not equal” operator (<>), it starts assessing the conditions on opposite sides of the brackets.

Conclusion

There are several ways to determine whether a cell is blank or not. Among them, using the IF function is the prominent way. You can combine the IF function with ISBLANK to add additional value to your formula.

As the IF function is a logical function, your created formulas won’t be complex.