+ Reply to Thread
Results 1 to 5 of 5

Getting a the max value of an array of the sums of multiple columns? Is it possible?

  1. #1
    Registered User
    Join Date
    03-07-2011
    Location
    Detroit, MI
    MS-Off Ver
    Excel 2003, 2007, & 2010
    Posts
    52

    Question Getting a the max value of an array of the sums of multiple columns? Is it possible?

    Having a hard time thinking of a method of doing this within a single cell. Hopefully you guys/gals can help. Basically what I am looking to do is find a way to create a dynamic array of the sums of individual columns and return the maximum value in that array. Below is the best I could come up with but it is only dynamic in height. I would like the quantity of columns to also be dynamic. The example code below is using a range of A1:E5. An example would be if each column is a Day and each row is a quantity I want to know what the maximum total quantity for a single day is.

    Please Login or Register  to view this content.
    The easy way would be to have an additional row of totals and which have a dynamic height [i.e. =sum(offset(A1,0,0,Num_Of_Rows))] and then use a separate cell to set a dynamic width across the total row for the maximum [i.e. =max(offset(A6,0,0,0,Num_Of_Columns))] but I don't have the ability to have a totals row here.

    Hopefully there is another solution you can help me find. Thanks.

    FYI this has been crossposted here:
    Getting a the max value of an array of the sums of multiple columns? Is it possible?
    Last edited by drew.j.harrison; 06-16-2015 at 06:36 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    07-29-2009
    Location
    Belgium
    MS-Off Ver
    Excel 2003/Excel 2010
    Posts
    534

    Re: Getting a the max value of an array of the sums of multiple columns? Is it possible?

    Something along these lines (ctrl-shift-enter)
    Please Login or Register  to view this content.

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Getting a the max value of an array of the sums of multiple columns? Is it possible?

    Building on WHER's idea, if you want the number of columns to adjust themselves, let's assume row1 always has a value in every used column, then this version:

    =MAX(SUBTOTAL(9, OFFSET(A1,0, COLUMN(OFFSET(A1, , , , COUNTA(1:1)))-1, Num_of_Rows, 1)))

    ...also with CTRL+SHIFT+ENTER.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  4. #4
    Registered User
    Join Date
    03-07-2011
    Location
    Detroit, MI
    MS-Off Ver
    Excel 2003, 2007, & 2010
    Posts
    52

    Re: Getting a the max value of an array of the sums of multiple columns? Is it possible?

    Never did post an update here but this was solved on the cross-posted thread with the following code:

    {=MAX(MMULT(TRANSPOSE($B$2:$F$17)+0,ROW($A$2:$A$17)^0))}

    Thanks for the help!

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

    Re: Getting a the max value of an array of the sums of multiple columns? Is it possible?

    Nice one!

    And if you want the max sum of rows:

    Data Range
    A
    B
    C
    D
    E
    F
    5
    42
    1
    7
    84
    134
    6
    58
    94
    84
    22
    258
    7
    52
    8
    18
    78
    156
    8
    30
    40
    6
    59
    135
    9
    36
    14
    50
    9
    109
    10
    36
    31
    82
    75
    224
    11
    ------
    ------
    ------
    ------
    ------
    ------


    Array entered**:

    =MAX(MMULT(A5:D10,TRANSPOSE(COLUMN(A5:D5)^0)))

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

+ 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. Subtotals/sums based on criteria in multiple columns
    By pcaldwell in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-09-2015, 03:12 PM
  2. [SOLVED] Sum Formula based on single or multiple critera that sums accross and array
    By Dial1 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-27-2013, 07:14 PM
  3. Multiple Sums into one ROW from various Columns
    By vitaminallan in forum Excel General
    Replies: 12
    Last Post: 03-26-2012, 06:04 AM
  4. Array on multiple columns
    By Yot in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 08-04-2011, 05:35 PM
  5. SUM array with multiple columns
    By carsto in forum Excel General
    Replies: 1
    Last Post: 10-31-2006, 03:13 AM

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