+ Reply to Thread
Results 1 to 13 of 13

SUMING two columns

Hybrid View

  1. #1
    Registered User
    Join Date
    04-08-2013
    Location
    Wajdušna
    MS-Off Ver
    Office 365
    Posts
    80

    SUMING two columns

    Hello Excel masters,

    I have a question that might be stupid but i cant find an easy solution.
    To present the problem i will help myself with this table:
    23 2 13
    34 2 12
    12 2 11
    12 2 14
    13 2 15
    15 2 16
    16 2
    14 2
    22 2
    13 2

    is there any way to do equation in one cell which would sum all the values in column 2 where values from column 4 (last) (whole column - the array) are equal to values in column 1. In this upper case the sum would be 14. one way is to transpose the column 4 then it would work but i dont want to solve it this way :D

    thanx for help

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: SUMING two columns

    e1 =Sumif($A$1:$A$10,$D1,$B$1:$B$10) and drag down (and after that sum column E).
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Registered User
    Join Date
    04-08-2013
    Location
    Wajdušna
    MS-Off Ver
    Office 365
    Posts
    80

    Re: SUMING two columns

    That would be fine , but i want to do that equation in one cell,
    since my problem is a little bit more complicated than that shown in the post. And i want to know if that kind of SUM is even possible.

  4. #4
    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
    53,051

    Re: SUMING two columns

    Quote Originally Posted by ATOP View Post
    That would be fine , but i want to do that equation in one cell,
    since my problem is a little bit more complicated than that shown in the post. And i want to know if that kind of SUM is even possible.
    That is not possible with regular formulas, you can have either a value/entry in a cell OR a formula, not both
    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

  5. #5
    Registered User
    Join Date
    04-08-2013
    Location
    Wajdušna
    MS-Off Ver
    Office 365
    Posts
    80

    Re: SUMING two columns

    thanx for fast replays

    FDibbins i dont think we understood each other correctly it dosent need to be the same cell where there is an entry already, to put thing in perspective i dont have values in column D(as shown in table), i have an array of values(which i receive from another formula) that is formed as a column, and i cannot add extra columns for an array What bugs me is that if array would be formed as a row the thing would work, but since its comparing two columns excel fails to recognize which values are the same since it only cheks the first row in column D and ignores the rest.

    i hope it more understandable now?

  6. #6
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: SUMING two columns

    Maybe it can be done, but what is the problem using helpcolumns.

    It makes it a lot easier to understand (and change) the formula.

  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: SUMING two columns

    I think this is what you want...

    Data Range
    A
    B
    C
    D
    E
    1
    23
    2
    13
    Result
    2
    34
    2
    12
    14
    3
    12
    2
    11
    4
    12
    2
    14
    5
    13
    2
    15
    6
    15
    2
    16
    7
    16
    2
    8
    14
    2
    9
    22
    2
    10
    13
    2
    11
    ------
    ------
    ------
    ------
    ------


    This formula entered in E2:

    =SUMPRODUCT(SUMIF(A1:A10,C1:C6,B1:B10))
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  8. #8
    Registered User
    Join Date
    04-08-2013
    Location
    Wajdušna
    MS-Off Ver
    Office 365
    Posts
    80

    Re: SUMING two columns

    haha Tony thanks so easy at the end, i will try this one, that is what i had in mind yap i tried gazilion of combination with sumproduct but somehow was convinced that it wont work with sumif :D

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

    Re: SUMING two columns

    Another way using SUMPRODUCT:

    =SUMPRODUCT(--ISNUMBER(MATCH(A1:A10,C1:C6,0)),B1:B10)

    I like the SUMPRODUCT(SUMIF version better. Less typing!

  10. #10
    Registered User
    Join Date
    04-08-2013
    Location
    Wajdušna
    MS-Off Ver
    Office 365
    Posts
    80

    Re: SUMING two columns

    Quote Originally Posted by Tony Valko View Post
    Another way using SUMPRODUCT:

    =SUMPRODUCT(--ISNUMBER(MATCH(A1:A10,C1:C6,0)),B1:B10)

    I like the SUMPRODUCT(SUMIF version better. Less typing!
    it would also work just with SUM and fancy brackets {} {=SUM(ISNUMBER(MATCH(A1:A10,C1:C6,0))*B1:B10)}, but sumif is the most elegant way i agree. Thanks again this opens many new options for me the next time i will need to calculate something :D

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

    Re: SUMING two columns

    You're welcome!

  12. #12
    Registered User
    Join Date
    04-08-2013
    Location
    Wajdušna
    MS-Off Ver
    Office 365
    Posts
    80

    Re: SUMING two columns

    Thanks works like a charm

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

    Re: SUMING two columns

    You're welcome. Thanks for the feedback!

+ 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. Suming Columns While Ignoring #VALUE! Errors in the Columns
    By Stryker152 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-21-2014, 09:27 AM
  2. Suming up alternative rows/columns
    By Phaneendra in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-12-2013, 10:47 AM
  3. Suming
    By kawika007 in forum Excel General
    Replies: 2
    Last Post: 10-20-2011, 01:37 PM
  4. suming last 3 columns in pivot table
    By richurb in forum Excel General
    Replies: 0
    Last Post: 03-19-2010, 09:04 AM
  5. Vlookup and Suming columns
    By Paul1975 in forum Excel General
    Replies: 1
    Last Post: 10-08-2008, 10:30 AM
  6. Suming N/A
    By Steel_lady in forum Excel General
    Replies: 13
    Last Post: 01-29-2008, 05:21 PM
  7. Suming
    By Joshdube in forum Excel General
    Replies: 3
    Last Post: 06-28-2007, 02:36 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