+ Reply to Thread
Results 1 to 7 of 7

Summing numbers even if they don't exist

  1. #1
    Registered User
    Join Date
    06-03-2014
    Posts
    10

    Summing numbers even if they don't exist

    Hi!

    I want to sume numbers that may or may not be in several cells. If I use the function SUM and one of them is missing, I get an error.

    Example:
    A1=2
    A2="empty"
    A3=5

    I want the sum of A1+A2+A3 to be 5

    Any ideas?

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Summing numbers even if they don't exist

    Do you mean?

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

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,444

    Re: Summing numbers even if they don't exist

    What formula are you using?

    If I enter =SUM(A1:A3) with the values you suggest, i get a result of 7, which is correct, I believe?
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  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,446

    Re: Summing numbers even if they don't exist

    When you say "empty", please can you clarify. Your formula should cope with an empty/null cell. However, if it has a space or a non numeric character it won't.


    A
    B
    C
    1
    2
    #VALUE!
    =A1+A2+A3
    2
    x
    7
    =SUM(A1:A3)
    3
    5
    7
    =N(A1)+N(A2)+N(A3)
    4
    7
    =SUMPRODUCT(--(ISNUMBER($A$1:$A$3)),($A$1:$A$3))



    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 XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Summing numbers even if they don't exist

    Yes.

    Big difference between using =A1+A2+A3 and =SUM(A1:A3)

    The latter ignores text values in the range; the former does not.

    I can only imagine that your "blanks" in the range are not "genuine" blanks, but perhaps the "" (which are technicallly text) as a result of e.g. formulas in those cells.

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  6. #6
    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,446

    Re: Summing numbers even if they don't exist

    Added Fotis's formula as another option:


    A
    B
    C
    1
    2
    #VALUE!
    =A1+A2+A3
    2
    x
    7
    =SUM(A1:A3)
    3
    5
    7
    =N(A1)+N(A2)+N(A3)
    4
    7
    =SUMPRODUCT(--(ISNUMBER($A$1:$A$3)),($A$1:$A$3))
    5
    7
    =SUMIF(A1:A3,"<>")



    Regards, TMS

  7. #7
    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,446

    Re: Summing numbers even if they don't exist

    Thanks for the rep



    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

+ 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] Figuring out which numbers don't exist in list
    By dip11 in forum Excel General
    Replies: 3
    Last Post: 08-01-2012, 07:32 AM
  2. Which numbers do not exist
    By djblois1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-27-2011, 10:02 AM
  3. Numbers Exist/Not exist in a range
    By ElmerS in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-04-2008, 04:34 PM
  4. Combining 2 cells numbers unless one doesn't exist
    By desk.doc in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-11-2007, 03:24 PM
  5. How to tell if a number exist in a range of numbers?
    By Waynesworld in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-12-2006, 02:02 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