ExcelTip.com
ExcelTip.com
Account Icon Account Icon Account Icon
Google Exceltip.com
JOIN OUR NEWSLETTER
  and receive for joining:
Free eBook Learn More!
Free Excel ADD-IN
Free Weekly Excel Tip
4 e-books in cd-rom
F1 Formulas & Functions
F1 Formulas & Functions
F1 EXCEL
F1 eBook (Spanish)
F1 EXCEL
Financial Statements.xls
 

» Adjusting a Formula to Return a Blank, Rather than a Zero, When Operating on Empty Cells
Problem:

List1 (column A) includes numbers as well as blank cells.
When using the following formula to multiply each number in List1 by 3:
=IF(ISBLANK(A2),,A2*3)
Zeros are returned for all empty cells.
We want to adjust the formula so that blanks are returned for all empty cells in List1.

Solution:

Use two quote marks (""), as shown in the adjusted formula below, to indicate that a blank should be returned:
=IF(ISBLANK(A2),"",A2*3)


Rate this tip
12 34 5
  RATING: 4.00
  VIEWS: 22089

READER COMMENTS (view all comments)


Error
AlieL wrote on August 23, 2005 04:21 EST
i try to use the formula you post, but there is an error as i execute it.
=IF(ISBLANK(A2),"",A2*3) is not a blank cell but an empty string
Takeshi wrote on December 31, 1969 19:00 EST
=IF(ISBLANK(A2),"",A2*3) has some problem because =ISBLANK(IF(ISBLANK(A2),"",A2*3)) returns false while =ISTEXT(IF(ISBLANK(A2),"",A2*3)) returns true when A2 is blank
wrong
youcantryreachingme (Chris) wrote on December 31, 1969 19:00 EST
the previous comment is right - this is not leaving the cell blank, it is assigning an empty string.

i have a chart, and for charts you can tell excel how to handle blank cells - but in the case of a zero value or an empty string, the chart plots a zero value

what i want is a formula to properly return a blank cell (if conditions are correct) so that i can use my chart setting to inerpolate that value.

the supplied answer is just wrong.
would love to know the answer
williamsbg wrote on July 20, 2006 08:01 EST
Teh first question was important the answer was wrong. Let me restate it.

I have a formula:

=IF(some condition is true,5,"")

If the condition is true I want to plot the number 5. If it is false I want to treat the cell as though I had hit the delete key so that it ignores that data point completely. The question is: What do we need to put there in place of ""?
The answer is 42
williamsbg wrote on July 20, 2006 08:10 EST
Just found the answer on another site! Here it is....

Rob -

Even if it looks blank, a cell with a formula isn't, it returns "",
which Excel plots as zero, like any text string. Replace the "" in the
formula with NA(), which returns an #N/A error in the cell. It looks
ugly in the sheet, but is interpolated over by the chart. Use
conditional formatting to hide the error in the worksheet. If the chart
has lines connecting the data, the line will go from the point before
#N/A to the point after; you can't make the line stop, to leave a gap.
Tushar Mehta has an addin on his web site that removes the formula with
#N/A by a blank cell ([url]http://tushar-mehta.com)[/url], which helps the chart,
but removes the dynamic nature of a cell with a formula. We need MS to
invent a BLANK() or NULL() worksheet function.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
[url]http://www.geocities.com/jonpeltier/Excel/index.html[/url]
#NA isn't really a "blank cell" for sorting purposes
jfkelley wrote on August 15, 2007 09:14 EST
My challenge:
I have a formula that calculates an integer value if all the antecedent cells are non-blank. Else, it puts a blank ("").

If I were Ascending sorting, this would be fine (put all blanks at the end). However, I am Descending sorting and all the "" cells come out on top!

I tried the NA() solution above, but the result is the same, they come out on top, i.e., #NA is not a true "blank cell". (BTW: If I go to my formula cells and Delete, achieving a True "blank cell", then the Descending sort works as I want it to, i.e., the nulls get sorted down underneath the cells with numeric values in them.)

Unfortunately, there is no ascii character (that I can find) that will sort underneath numbers in a Descending sort.



REGISTERED USERS - Click here to post comments


GUESTS (Click here to register)
Name
Comment Title
Comments

Getting to Yes: Negotiating Agreement Without Giving In

422 Tax Deductions for Businesses and Self-Employed Individuals : You Get a Raise Every Time You Find a Legitimate Tax Deduction

Business Analysis and Valuation: Using Financial Statements, Text and Cases

Microsoft Windows XP Inside Out

The Financial Numbers Game: Detecting Creative Accounting Practices

Understanding Financial Statements

RELATED MICROSOFT EXCEL TIPS


Convert PDF Files to Excel






Excel VBA books
Accounting books
Business Plans
MS Office books
Taxes books

VIEW ALL BOOKS


  Advertise With Us                               

Tips

Add-In in VBA | Applications - Word, Outlook in VBA | Array Formulas | Cells, Ranges, Rows, and Columns in VBA | Counting | Custom Functions | Custom Functions in VBA | Database Formulas | Database in VBA | Date & Time Formulas | Date & Time in VBA | Events in VBA | Excel 2003 | Excel Chart | Excel Consolidating | Excel Counting | Excel Custom Functions using VBA | Excel Customizing | Excel Data | Excel Dates | Excel Editing | Excel Files | Excel Filter | Excel Format | Excel Formula | Excel General | Excel Grouping and Outlining | Excel Importing Text Files | Excel Information | Excel Keyboard Shortcuts | Excel Loan Formulas | Excel Macros - VBA | Excel Pivot Tables | Excel Printing | Excel Range Name | Excel Security - Protection | Excel Sorting | Excel Style | Excel Subtotals | Excel Summing | Excel Text | Excel Time | Excel Tools | Excel Worksheet, Workbook | Files, Workbook, and Worksheets in VBA | Financial Formulas | Formating in VBA | General Topics in VBA | Import and Export in VBA | Information Formulas | Keyboard & Other Shortcuts in VBA | Keyboard Formula Shortcuts | Links between Worksheet and Workbooks | Links in VBA | Logical Formulas | Lookup Formulas | Mail - Send and Receive in VBA | Menus, Toolbars, Status bar in VBA | Modules, Class Modules in VBA | Other Q&A Formulas | Printing in VBA | Protecting in VBA | Summing | Text Formulas | User Forms, Input boxes in VBA | Using Loops | Working with Formulas |

Tips by Version

Microsoft Excel 97 | Microsoft Excel 2000 | Microsoft Excel 2002 | All Microsoft Excel Versions | New in Excel 2002 | New in Excel 2003 - Office 11

Website

Home | Tip of Hour | Recommended Tips | Most Viewed Tips | Tips by Version | Submit a Tip | My Tips
Microsoft Excel Tutorials | Excel Links | Write for Us | About Us | Search Results | Tip Archives | Excel Forum | Excel Forum Archives

Excel Book

Excel 97 Book | Excel 2000 Book | Excel 2002 Book | Excel XP Book | Book Store

Terms and Conditions of use
The applications/code on this site are distributed as is and without warranties or liability. In no event shall the owner of the copyrights, or the authors of the applications/code be liable for any loss of profit, any problems or any damage resulting from the use or evaluation of the applications/code.

Copyright © 2003 ExcelTip.com
Microsoft, Microsoft Excel is a U.S. registered trademark of Microsoft Corporation
Site Developed By: Varien