+ Reply to Thread
Results 1 to 13 of 13

Ignoring blanks when calculating SUM

  1. #1
    Registered User
    Join Date
    08-12-2014
    Location
    AZ
    MS-Off Ver
    2007
    Posts
    3

    Ignoring blanks when calculating SUM

    I am using a simple SUM formula like this, =SUM(D10:E10). I would like for the SUM cell to be left blank until a value is entered into the cells D10. Currently it calculates the SUM as 0.

  2. #2
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,049

    Re: Ignoring blanks when calculating SUM

    For what purpose?

    You can try changing the cell formatting to get rid of the 0, or show a "-"
    or you can write an if statement, but it seems kinda awkward.

    Please Login or Register  to view this content.
    Last edited by mikeTRON; 08-12-2014 at 06:49 PM.
    Please ensure you mark your thread as Solved once it is. Click here to see how.
    If a post helps, please don't forget to add to our reputation by clicking the star icon in the bottom left-hand corner of a post.

  3. #3
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Ignoring blanks when calculating SUM

    try this

    Please Login or Register  to view this content.
    Ernest

    Please consider adding a * if I helped

    Nothing drives me crazy - I'm always close enough to walk....

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: Ignoring blanks when calculating SUM

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



    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  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: Ignoring blanks when calculating SUM

    One way...

    Assumes D10 and E10 will only contain numbers.

    =IF(D10="","",D10+E10)
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  6. #6
    Registered User
    Join Date
    08-12-2014
    Location
    AZ
    MS-Off Ver
    2007
    Posts
    3

    Re: Ignoring blanks when calculating SUM

    How do I change the cell formatting to get rid of the 0 or show a "-"?

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: Ignoring blanks when calculating SUM

    =if(d10="","-",d10+e10)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  8. #8
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,049

  9. #9
    Registered User
    Join Date
    08-12-2014
    Location
    AZ
    MS-Off Ver
    2007
    Posts
    3

    Re: Ignoring blanks when calculating SUM

    I appreciate all of the help. The ideas work but it's very cumbersome. I was just hoping for an easier way. It just seems that if there is nothing in the reference cells, the formula cell should also remain blank until something in entered into the reference cells. Thanks for all the help.

  10. #10
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Ignoring blanks when calculating SUM

    just format the cell as accounting no symbol
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  11. #11
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: Ignoring blanks when calculating SUM

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



    Regards, TMS

  12. #12
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Ignoring blanks when calculating SUM

    maybe it needs tweaking to avoid 0.00?

  13. #13
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: Ignoring blanks when calculating SUM

    Well, I think it will show 0.00 if you only show 2 decimal places but have something like 0.001 ... but, in reality, it's not a zero value. So maybe it should show something other than "-"?

    Chasing a dream now. Not sure what we're tying to achieve.

  14. #14
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,049

    Re: Ignoring blanks when calculating SUM

    LOL. Chasing a dream. Perfect.

+ 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. [SOLVED] Ignoring blanks (again)
    By jswainson in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-12-2012, 07:47 AM
  2. [SOLVED] Ignoring blanks
    By jswainson in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-30-2012, 10:28 AM
  3. [SOLVED] Ignoring blanks
    By jswainson in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-09-2012, 02:44 PM
  4. [SOLVED] Ignoring blanks
    By jswainson in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-09-2012, 02:14 PM
  5. Ignoring blanks
    By exsam21 in forum Excel General
    Replies: 2
    Last Post: 01-18-2006, 01:25 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