+ Reply to Thread
Results 1 to 7 of 7

If formula result is zero, return "" (blank) - Any way to simplify this?

  1. #1
    Forum Contributor
    Join Date
    03-14-2013
    Location
    England
    MS-Off Ver
    2007
    Posts
    186

    If formula result is zero, return "" (blank) - Any way to simplify this?

    Hi,

    This is just a general question about something I come across quite frequently....

    When I want to leave a cell blank where the result of the formula would be zero, I tend to find myself using an IF argument to ask if the result is greater than zero, and if so, repeat the formula, if not then ""

    If the formula is quite long, it seems a bit silly really, for example...... (And this isn't even what I would call long by any means)...

    This:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Would become this:

    Formula: copy to clipboard
    Please Login or Register  to view this content.



    Is there some better way to do this or simplify this kind of situation so that you don't have to repeat the same thing twice?

    Perhaps using a different function that im not aware of?

    Or if not, would it be possible to create a custom function with vba?


    I am interested to hear peoples thought and ideas on this.

    Many thanks
    Last edited by D.Lovell; 05-29-2015 at 05:44 PM.

  2. #2
    Valued Forum Contributor nigelbloomy's Avatar
    Join Date
    11-06-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    1,011

    Re: If formula result is zero, return "" (blank) - Any way to simplify this?

    I usually just wrap an iferror around the first formula. That way it either calculates or I can tell it to be blank using "". I like iferror because it doesn't double the formula. There may be other ways to handle it too though.
    Some people volunteer in soup kitchens or hospitals. I choose to make the world better by trying to help you with Excel. We're all learning.

    <---Click * Add Reputation for all helpful comments. It's like giving a smile.
    Forum Rules: How to mark your post [Solved] and have a happier, Excel enriched life.

  3. #3
    Forum Contributor
    Join Date
    03-14-2013
    Location
    England
    MS-Off Ver
    2007
    Posts
    186

    Re: If formula result is zero, return "" (blank) - Any way to simplify this?

    Hi there,

    Thanks for your response.

    Yes I am well aware if the IFERROR function, I also use that frequently too......

    The situation I am describing here though, it does not help because the result of the formula is not an error or #DIV/0, the result is actually zero. I want it to display a blank cell rather than the zero.

    Any other functions in mind? Or can we make a custom one with vba?

  4. #4
    Forum Contributor
    Join Date
    03-14-2013
    Location
    England
    MS-Off Ver
    2007
    Posts
    186

    Re: If formula result is zero, return "" (blank) - Any way to simplify this?

    Maybe to help to be more clear, if I'm finding a value from a list of values based on various criteria or with a lookup function or something.... and some of the values in the list are zero. This is an example of when I encounter this situation where there seems to be no choice but the repeat the same formula twice inside a logic argument.

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: If formula result is zero, return "" (blank) - Any way to simplify this?

    Try this...

    =IFERROR(1/(1/SUMIFS(Data!$F$12:$F$23,Data!$B$12:$B$23,$B13,Data!$C$12:$C$23,Input!$J$5,Data!$D$12:$D$23,Input!$J$6)),"")
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  6. #6
    Forum Contributor
    Join Date
    03-14-2013
    Location
    England
    MS-Off Ver
    2007
    Posts
    186

    Re: If formula result is zero, return "" (blank) - Any way to simplify this?

    Hi there,

    Sorry for the slow reply....

    This is exactly what I was looking for, div 1 of course, can't believe I didn't think of this.

    Thanks very much for your helpful reply

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: If formula result is zero, return "" (blank) - Any way to simplify this?

    You're welcome. Thanks for the feedback!


    If your question has been solved please mark the thread as being solved.

    In the menu bar above the very first post select Thread Tools, then select Mark this thread as solved.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 8
    Last Post: 07-06-2014, 08:51 PM
  2. Replies: 3
    Last Post: 02-16-2011, 02:55 PM
  3. Replies: 5
    Last Post: 10-12-2010, 06:46 AM
  4. [SOLVED] How do I replace a "#N/A" formula result with a blank in excel?
    By yrat in forum Excel General
    Replies: 6
    Last Post: 04-02-2006, 11:40 PM
  5. [SOLVED] "=RESULT()", "=ARGUMENT()", "=RETURN()" ??
    By PeteCresswell in forum Excel General
    Replies: 1
    Last Post: 03-31-2005, 04:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1