+ Reply to Thread
Results 1 to 20 of 20

Finding maximum of column totals by dates

  1. #1
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,069

    Finding maximum of column totals by dates

    Dear All

    I would like to find the maximum of column totals by dates:

    In the example below, for 01/08/21
    Count1 = 1 + 0 + 1 = 2
    Count2 = 1 + 1 + 1 = 3
    Count3 = 1 + 0 + 0 = 1
    Count4 = 0 + 0 + 0 = 0
    MaxCount = MAX(2,3,1,0) = 3

    Thank you!

    Maximum of sum of column totals by dates.png
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: Finding maximum of column totals by dates

    Try this:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Regards,
    Aardigspook

    I recently started a new job so am a bit busy and may not reply quickly. Sorry - it's not personal - I will reply eventually.
    If your problem is solved, please go to 'Thread Tools' above your first post and 'Mark this Thread as Solved'.
    If you use commas as your decimal separator (1,23 instead of 1.23) then please replace commas with semi-colons in your formulae.
    You don't need to give me rep if I helped, but a thank-you is nice.

  3. #3
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,069

    Re: Finding maximum of column totals by dates

    Thank you Aardigspook for your answer.

    I forgot to mention.. there are more than 50 columns from Count1 to Count50 in my actual workbook.
    Last edited by josephteh; 08-20-2021 at 06:45 AM.

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,359

    Re: Finding maximum of column totals by dates

    try

    =MAX(SUMIF(Table1[[#All],[Date]],[@Date],Table1[[#All],[Count1]]),SUMIF(Table1[[#All],[Date]],[@Date],[Count2]),SUMIF(Table1[[#All],[Date]],[@Date],[Count3]),SUMIF(Table1[[#All],[Date]:[Count1]],[@Date],Table1[[#All],[Count4]]))

    Copy to G4, G7, G12 etc

    Just seen your comment re 50 COUNTS! (just a minor oversight).

    Probably VBA then ?

    Is format the same with COUNT1 in column C ?
    Last edited by JohnTopley; 08-20-2021 at 06:45 AM.

  5. #5
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,069

    Re: Finding maximum of column totals by dates

    Thanks JohnTopley for your answer.

    As mentioned above, I forgot to mention.. there are more than 50 columns from Count1 to Count50 in my actual workbook.

  6. #6
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,213

    Re: Finding maximum of column totals by dates

    Please try

    =IF(B3=B4,"",MAX(MMULT(TRANSPOSE(B4:INDEX(B4:B$24,MATCH(B4,B4:B$24))^0),C4:INDEX(F4:F$24,MATCH(B4,B4:B$24)))))

    Ctrl+Shift+Enter
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,069

    Re: Finding maximum of column totals by dates

    Thank you, Bo_Ry! Works perfectly! Possible to have non-array formula?

  8. #8
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,213

    Re: Finding maximum of column totals by dates

    Try this normal enter

    =IF(B3=B4,"",MAX(MMULT(COLUMN(A$1:INDEX($1:$1,MATCH(B4,B4:B$24)))^0,C4:INDEX(F4:F$24,MATCH(B4,B4:B$24)))))

    if the above formula does not work with Normal enter, try below.

    =IF(B3=B4,"",MAX(INDEX(MMULT(COLUMN(A$1:INDEX($1:$1,MATCH(B4,B4:B$24)))^0,C4:INDEX(F4:F$24,MATCH(B4,B4:B$24))),)))
    Attached Files Attached Files

  9. #9
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,069

    Re: Finding maximum of column totals by dates

    Thank you, Bo_Ry! Perfect!

  10. #10
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,069

    Re: Finding maximum of column totals by dates

    Sorry, Bo_Ry.. need your further help! If I insert columns between Count3 and Count4, both the array and non-array formulas show #VALUE! errors.

    I don't know how to adapt the formulas.

  11. #11
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,213

    Re: Finding maximum of column totals by dates

    MMULT doesn't like blank
    fill number to the insert column or add --

    Try
    =IF(B3=B4,"",MAX(MMULT(COLUMN(A$1:INDEX($1:$1,MATCH(B4,B4:B$24)))^0,--C4:INDEX(F4:F$24,MATCH(B4,B4:B$24)))))

  12. #12
    Forum Contributor
    Join Date
    04-15-2013
    Location
    Singapore, Melbourne
    MS-Off Ver
    Office 365
    Posts
    167

    Re: Finding maximum of column totals by dates

    Please try below array formula in G4:

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


    if you insert columns into the table, just change this part [ROW($1:$4)] to the total column numbers of your count header fields. for example: ROW($1:$50) for 50 columns
    Row row row your boat
    Gently down the stream

  13. #13
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,069

    Re: Finding maximum of column totals by dates

    Thanks Metoo7, it works! I have adapted your formula to the following so I may insert columns before Count4 without having to change the formula:
    Please Login or Register  to view this content.

  14. #14
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,069

    Re: Finding maximum of column totals by dates

    Oh, by the way, I have to CSE the formula.

  15. #15
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,069

    Re: Finding maximum of column totals by dates

    Metoo7, one more thing.. is it possible to make the formula to SUM, rather than COUNT? Because the values are not just 0 or 1, it may also be other integer numbers. Thank you.

  16. #16
    Forum Contributor
    Join Date
    04-15-2013
    Location
    Singapore, Melbourne
    MS-Off Ver
    Office 365
    Posts
    167

    Re: Finding maximum of column totals by dates

    That's good.

  17. #17
    Forum Contributor
    Join Date
    04-15-2013
    Location
    Singapore, Melbourne
    MS-Off Ver
    Office 365
    Posts
    167

    Re: Finding maximum of column totals by dates

    Quote Originally Posted by josephteh View Post
    Metoo7, one more thing.. is it possible to make the formula to SUM, rather than COUNT? Because the values are not just 0 or 1, it may also be other integer numbers. Thank you.
    You may use SUMIFS as below.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  18. #18
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    Australia
    MS-Off Ver
    365 V2403 and WPS V2022
    Posts
    3,493

    Re: Finding maximum of column totals by dates

    Cell G4 formula , Drag down

    HTML Code: 

  19. #19
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,069

    Re: Finding maximum of column totals by dates

    Thank you, another brilliant formula!

  20. #20
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    Australia
    MS-Off Ver
    365 V2403 and WPS V2022
    Posts
    3,493

    Re: Finding maximum of column totals by dates

    You're Welcome. Glad to help . Thank You 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. [SOLVED] Finding column header and value of first column based on maximum value of range
    By dpalmer76 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-05-2021, 10:04 AM
  2. [SOLVED] Finding Maximum from Cell to Last Entry in each column : Using For..Next
    By subbby in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-16-2018, 02:08 PM
  3. [SOLVED] finding a maximum value from column which has grouped data
    By learnings in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-10-2017, 03:26 AM
  4. Finding maximum between dates with a suffixed number
    By subbby in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-02-2016, 03:13 PM
  5. Finding an adjacent value after finding a maximum value on another column
    By VanCricken in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-10-2016, 11:58 AM
  6. Replies: 7
    Last Post: 10-07-2015, 03:01 PM
  7. finding the minimum value in a column that comes after the maximum value
    By rantarctica in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-11-2008, 04:42 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