Excel Formula to Return Blank If Cell Value Is Negative

There are 2 suitable ways to return a blank if the cell value is negative in an Excel formula: by using the IF function and by using the Format Cells option.

To demonstrate our methods, we’ll use the following dataset. We’ll calculate the Profit by subtracting the Selling Price from the Buying Price, and show a blank cell if the value is negative.

Suitable Ways to Use Excel Formula to Return Blank If Cell Value Is Negative


Method 1 – Using the IF Function

Steps:

  • Select cell E5 and enter the following formula:
=IF(D5-C5<0,"",D5-C5)
  • Press Enter to calculate the profit.

If the profit is a positive value, this value will be displayed.

Suitable Ways to Use Excel Formula to Return Blank If Cell Value Is Negative

  • Select cell E5 and drag the Fill Handle down to the rest of the cells in the column Profit.

When the calculated profit is negative, blank cells will be shown.

Read More: Excel Formula to Return Zero If Negative Value is Found


Method 2 – Using Format Cells Option

Steps:

  • Select cell E5 and enter the following formula:
=D5-C5
  • Press Enter to calculate the profit.

Suitable Ways to Use Excel Formula to Return Blank If Cell Value Is Negative

  • Select cell E5 and drag the Fill Handle down the entire column Profit.

Profits for the 5 products will be shown like in the image below

Suitable Ways to Use Excel Formula to Return Blank If Cell Value Is Negative

  • Select the range E5:E9.
  • Right-click on your mouse and select Format Cells from the Context menu.

Suitable Ways to Use Excel Formula to Return Blank If Cell Value Is Negative

The Format Cells window will appear.

  • Select Custom from the Category option.
  • Enter “0;”” “ in the Type box.
  • Click on OK.

Now where the calculated profit is negative, blank cells will be displayed.

Read More: Excel Formula If Cell Contains Negative Number


How to Display Blank Cells for Zeros in Excel

The IF function is also the easiest way to return a blank cell when the cell value is zero.

Steps:

  • Select cell E5 and enter the following formula:
=IF(D5-C5=0,"",D5-C5)
  • Press Enter to calculate the profit.

If the profit is positive, the value will be displayed.

Suitable Ways to Use Excel Formula to Return Blank If Cell Value Is Negative

  • Select cell E5 and drag the Fill Handle down the entire column Profit.

When the calculated profit is zero, a blank cell will be displayed.

Read More: How to Make a Group of Cells Negative in Excel


Things to Remember

  • Using the IF function is the easiest way to return a blank cell if the calculated value from Excel formula is negative.
  • If you use the Format Cells option, your particular format for those cells will be lost and it will display the customized format you have written.

Download Practice Workbook


Related Articles


<< Go Back to Negative Numbers in Excel | Number Format | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Md. Asaduzzaman
Md. Asaduzzaman

Hello! I am Md. Asaduzzaman. Currently, I am working as an Excel and VBA Content Developer and I will be posting my articles related to this here. I graduated from Bangladesh University of Science and Technology(BUET) in 2022. I completed my BSc in Naval Architecture and Marine Engineering. I like to solve real-life problems in Microsoft Excel and share the solutions through articles. I post here regularly. Hope you find the articles helpful.

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo