+ Reply to Thread
Results 1 to 8 of 8

What excel does when a + is added inside of a SUM function

  1. #1
    Registered User
    Join Date
    08-10-2023
    Location
    Portugal
    MS-Off Ver
    Office 365
    Posts
    2

    What excel does when a + is added inside of a SUM function

    Hi,

    During a calculation I have made the following that, now I know it is wrong:
    A1=1
    A2=2
    A3=3
    A4=4

    =sum(A1:A3+A4)
    the result of this is 18 and I don't understand why.

    Could someone explain why this is happening? This is the curiosity speaking as I understand that we should use the "," like this =sum(A1:A3,A4)

    Thanks
    Nuno

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,926

    Re: What excel does when a + is added inside of a SUM function

    The way you wrote it will add A4 to each cell in the range, so you will actually be getting the SUM of (1+4), (2+4) AND (3+4).

    Hope this helps.

    Pete

  3. #3
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,229

    Re: What excel does when a + is added inside of a SUM function

    If you use the "Evaluate formula" button on the formula tab you can step through the calculation to see what is happening.
    In this case it's adding 4 to every value in A1:A3

  4. #4
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,466

    Re: What excel does when a + is added inside of a SUM function

    =sum(a1:a3+a4) =sum(a1+a4,a2+a4,a3+a4) =sum(1+4,2+4,3+4) =sum(5,6,7) =18

  5. #5
    Registered User
    Join Date
    08-10-2023
    Location
    Portugal
    MS-Off Ver
    Office 365
    Posts
    2

    Re: What excel does when a + is added inside of a SUM function

    Thanks so much for your replies! Cristal clear.

  6. #6
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,229

    Re: What excel does when a + is added inside of a SUM function

    Glad to help & thanks for the feedback

  7. #7
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,466

    Re: What excel does when a + is added inside of a SUM function

    You are Welcome! Thanks for the feedback.

  8. #8
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,926

    Re: What excel does when a + is added inside of a SUM function

    If that takes care of your original question, please take a moment to select Thread Tools from the menu above and to the right of your first post in this thread, and mark the thread as SOLVED.

    Also, since you are relatively new to the forum, you might like to know that you can directly thank those who have helped you by clicking on the small "star" icon located in the lower left corner of a post that you have found to be helpful (not just in this thread - for any post that has helped you). This also adds to the reputation of the poster (the small green bars in the poster's profile).

    Pete

+ 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] Convert date text inside a cell into DATE() type inside a function
    By xChristy in forum Excel General
    Replies: 4
    Last Post: 06-04-2020, 09:44 AM
  2. INDIRECT/ADDRESS inside LINEST function versus inside INTERCEPT
    By slny06 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-14-2019, 08:51 AM
  3. I am trying to use an Excel function inside my VBA code
    By starlev in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-12-2017, 07:05 AM
  4. Replies: 11
    Last Post: 06-01-2015, 02:21 AM
  5. Replies: 0
    Last Post: 01-19-2013, 01:35 PM
  6. Unprotect an excel sheet from inside a function
    By Typicalalex1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-17-2010, 02:28 PM
  7. Using a range variable inside a excel function
    By Michael in forum Excel General
    Replies: 2
    Last Post: 11-14-2005, 10:55 AM

Tags for this Thread

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