+ Reply to Thread
Results 1 to 8 of 8

SUM MAX accross columns

  1. #1
    Registered User
    Join Date
    03-05-2011
    Location
    Sweden
    MS-Off Ver
    Excel 2003
    Posts
    6

    SUM MAX accross columns

    Hi,
    I have anexcel file with data of type:
    500 200 2000
    1000 0 6000
    ranging from cell C7 to AL37.

    I have been trying to return the maximum of two cells (same column, different rows), add the results and return in a different ceel e.g. if i consider the sample above then i will like it to return:
    1000 + 200 + 6000.
    I tried to use
    SUM(MAX(C7;C8):MAX(AL7:AL8) to return the reults for two rows, but it only compute the first and last column. Is there a way i can compute all the columns without having to explicitly specify them out?

    Thanks in Advance
    Manywise

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: SUM MAX accross columns

    You can use an "array formula" like this

    =SUM(IF(C7:AL7>C8:AL8,C7:AL7,C8:AL8))

    confirmed with CTRL+SHIFT+ENTER

    or a "regular" formula

    =SUMPRODUCT(SUBTOTAL(4,OFFSET(C7:C8,0,COLUMN(C7:AL7)-COLUMN(C7))))
    Audere est facere

  3. #3
    Registered User
    Join Date
    03-05-2011
    Location
    Sweden
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: SUM MAX accross columns

    Thanks a lot, this seems to have some major key issues:
    Applying the two formulaes to a small data set as shown below:
    rows 7 to 9, columns C to E

    1000 1500 500
    500 600 1000
    0 1000 0

    Array formula
    =SUM(IF($C$7:$AL$7>C8:AL8;$C$7:$AL$7;C8:AL8))
    Results: 2100, 3000
    Regular formula
    SUMPRODUCT(SUBTOTAL(4;OFFSET($C$7:C8;0;COLUMN($C$7:$AL$7)-COLUMN($C$7))))
    Results: 3000, 3000

    The right answer is 1000 + 1500 + 1000= 2500 for rows 7 and 8 and 1000+1500+500=3000 for rows 7 and 9.

    I have used "$" to keep keep a fix row and calculate the sum max for the combination of that row with all the other rows by using excel drag/drop function. I am using microsoft office excel 2007 hence i changed "," to ";" from the formula you suggested.

    Is there anyone who can please help me with what is going on, and what is the right thing for m e to do?
    Thanks
    Manywise

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: SUM MAX accross columns

    The correct answer for row 7 to 8 is 3500 and that is what daddylonglegs' formulae will return
    we are assuming of course you confirmed the first as an Array using CTRL + SHIFT + ENTER (enter alone will not suffice)

    If you wish to compare row 7 to row 9 (ie non contiguous range) then you will need to adjust the references in the Array to row 8 accordingly:

    Please Login or Register  to view this content.
    The SUMPRODUCT would prove cumbersome to adjust for non-contiguous ranges.

  5. #5
    Registered User
    Join Date
    03-05-2011
    Location
    Sweden
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: SUM MAX accross columns

    Thanks, your advice does the magic, it's absolutely necessary to confirm CTRL + SHIFT + ENTER in every cell to get the right output.
    \Manywise

  6. #6
    Registered User
    Join Date
    03-05-2011
    Location
    Sweden
    MS-Off Ver
    Excel 2003
    Posts
    6

    excel row(a)/column(b) entries into a matrix (a,b) entry, results in one cell

    Hi,
    Anyone has an idea of how i can achieve the following:

    Using something like
    =(ROW(A2), COLUMN(B1))

    I will like it to return (content of row A2, content of column B1).

    In this particular case the contents are numbers i.e. (1,2).

    The target cell should return (1,2) in parenthesis.

    BR
    Manywise

  7. #7
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: SUM MAX accross columns

    Not very clear... perhaps you want:

    Please Login or Register  to view this content.
    Re: above...

    A cell can only ever present a single value - if you use an Array to generate the two different values, ie:

    Please Login or Register  to view this content.
    the cell containing the above will only ever display content of A2 (though the underlying Array holds both values)

  8. #8
    Registered User
    Join Date
    04-08-2011
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: SUM MAX accross columns

    why don't you pull out the max for each column first....and stick them somewhere else on your spreadsheet ...then add them together in another cell



    Quote Originally Posted by manywise View Post
    Thanks a lot, this seems to have some major key issues:
    Applying the two formulaes to a small data set as shown below:
    rows 7 to 9, columns C to E

    1000 1500 500
    500 600 1000
    0 1000 0

    Array formula
    =SUM(IF($C$7:$AL$7>C8:AL8;$C$7:$AL$7;C8:AL8))
    Results: 2100, 3000
    Regular formula
    SUMPRODUCT(SUBTOTAL(4;OFFSET($C$7:C8;0;COLUMN($C$7:$AL$7)-COLUMN($C$7))))
    Results: 3000, 3000

    The right answer is 1000 + 1500 + 1000= 2500 for rows 7 and 8 and 1000+1500+500=3000 for rows 7 and 9.

    I have used "$" to keep keep a fix row and calculate the sum max for the combination of that row with all the other rows by using excel drag/drop function. I am using microsoft office excel 2007 hence i changed "," to ";" from the formula you suggested.

    Is there anyone who can please help me with what is going on, and what is the right thing for m e to do?
    Thanks
    Manywise

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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