+ Reply to Thread
Results 1 to 8 of 8

Finding the max and sum of certain columns.

  1. #1
    Registered User
    Join Date
    03-22-2014
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    2

    Finding the max and sum of certain columns.

    In the attachment i am trying to return the sum of only the max of each of the rows of the two columns being search for in the second table.

    eg. for the first one the columns being searched are "a" and "b". I want it to look at both of the columns and for each row pick only the max and in the end sum them all together.

    Also in the end I would like to set a value for a, b, c and d and before it works out the max it would multiply the values set for the columns with each of the values under those columns.
    Attached Files Attached Files
    Last edited by Skalv; 03-22-2014 at 10:02 PM.

  2. #2
    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,946

    Re: How does one do this?

    g'day mate and welcome to the forum


    Could you provide a few sample answers?
    Last edited by FDibbins; 03-22-2014 at 10:07 PM.
    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

  3. #3
    Registered User
    Join Date
    03-22-2014
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: How does one do this?

    Well with "a" and "b" for the row max it would be 2,3,5,4,6,3,5,7 as they are the max values per row, then it would sum them all up to 35.

  4. #4
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: Finding the max and sum of certain columns.

    You may try this code. For detail see the attached sheet.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Finding the max and sum of certain columns.

    Hi,

    For the Sum of the Maximums then in I2 copied down
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

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

    Re: Finding the max and sum of certain columns.

    A bit long-winded but assuming your "multipliers" in row 11 you can use this array formula in I2 [revised]

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

    confirmed with CTRL+SHIFT+ENTER

    Of course you will get the same results for a and b as for b and a

    See attached where I set the multipliers to 1 so that currently works as if they don't exist
    Attached Files Attached Files
    Last edited by daddylonglegs; 03-23-2014 at 11:56 AM.
    Audere est facere

  7. #7
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Finding the max and sum of certain columns.

    Hi Skalv an welcome to the forum,

    I have a helper formula that spans columns and then does a sum at the end. It is a little easier to understand that the above examples (maybe). See if this answer is more to your liking.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  8. #8
    Forum Expert icestationzbra's Avatar
    Join Date
    01-07-2004
    MS-Off Ver
    2007, 2010
    Posts
    1,421

    Re: Finding the max and sum of certain columns.

    there are three parts to your question - #1) find maximum across rows; #2) total maxima; #3) multiply each column with a certain value.

    i think you should clearly think through what you need. if you want to find the maxima, add them and then apply the multiplier, that is just a bit complicated. but, if you want to do #1, then #3, then #2, it becomes more confusing / complicated.

    for e.g., in cell A3 and B3, you have 3 and 3. the maximum of those is 3. which multiplier are you going to apply - the one for column A or B?

    or, do you want to weed out rows where values are equal?

    also, do you mean to apply the multiplier before comparing? i don't think that is what you want because that will probably give you incorrect results.

    for e.g., in cell A2 and B2, you have 1 and 2. if the multiplier for column A were 2 and column B were 1 (or, 3 and 1), the results will be awry.

    anyway, if you just want to do #1 and #2, this is another way:

    Please Login or Register  to view this content.
    Last edited by icestationzbra; 03-25-2014 at 04:46 PM. Reason: spell check
    - i.s.z -
    CSE, aka Array aka { }, formulae are confirmed with CONTROL+SHIFT+ENTER.
    Replace commas ( , ) with semicolons ( ; ) in formulae, if your locale setting demands.
    All good ideas are courtesy resources from this forum as well as others around the web.
    - e.o.m -

+ 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