+ Reply to Thread
Results 1 to 6 of 6

Formula to get the Year of max record with condition

  1. #1
    Registered User
    Join Date
    06-03-2016
    Location
    Malaysia
    MS-Off Ver
    2010
    Posts
    56

    Formula to get the Year of max record with condition

    Hi,

    I would like to get the year of past highest record (column F) excluding Year 2021 from the "Raw" sheet, without using the pivot table helper, i appreciate if anyone can help.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    09-30-2019
    Location
    Chiangmai, Thailand
    MS-Off Ver
    Office 2016, Excel 2019
    Posts
    1,234

    Re: Formula to get the Year of max record with condition

    Please try

    F4
    Please Login or Register  to view this content.
    Follow with Ctrl-Shift-Enter for array formula.

    Regards.

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

    Re: Formula to get the Year of max record with condition

    Please try at

    F4
    =MOD(MAX(INDEX(ROUND(SUMIFS(Raw!$F$2:$F$1185,Raw!$E$2:$E$1185,B4,Raw!$C$2:$C$1185,C4,Raw!$A$2:$A$1185,ROW(Z$2010:Z$2021),Raw!$A$2:$A$1185,"<>2021")*10^6,)+ROW(Z$2010:Z$2021),)),10^4)

    F15
    =MOD(MAX(INDEX(ROUND(SUMIFS(Raw!$F$2:$F$1185,Raw!$E$2:$E$1185,B15,Raw!$D$2:$D$1185,C15,Raw!$A$2:$A$1185,ROW(Z$2010:Z$2021),Raw!$A$2:$A$1185,"<>2021")*10^6,)+ROW(Z$2010:Z$2021),)),10^4)
    Attached Files Attached Files

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2406 Win 11 Home 64 Bit
    Posts
    23,959

    Re: Formula to get the Year of max record with condition

    With Power Query, here is the Max per year. With this methodology, you can do the same for quarter, month or half by adding each to the query.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  5. #5
    Registered User
    Join Date
    06-03-2016
    Location
    Malaysia
    MS-Off Ver
    2010
    Posts
    56

    Re: Formula to get the Year of max record with condition

    Quote Originally Posted by menem View Post
    Please try

    F4
    Please Login or Register  to view this content.
    Follow with Ctrl-Shift-Enter for array formula.

    Regards.
    Thank you, it works for me

  6. #6
    Registered User
    Join Date
    06-03-2016
    Location
    Malaysia
    MS-Off Ver
    2010
    Posts
    56

    Re: Formula to get the Year of max record with condition

    Quote Originally Posted by Bo_Ry View Post
    Please try at

    F4
    =MOD(MAX(INDEX(ROUND(SUMIFS(Raw!$F$2:$F$1185,Raw!$E$2:$E$1185,B4,Raw!$C$2:$C$1185,C4,Raw!$A$2:$A$1185,ROW(Z$2010:Z$2021),Raw!$A$2:$A$1185,"<>2021")*10^6,)+ROW(Z$2010:Z$2021),)),10^4)

    F15
    =MOD(MAX(INDEX(ROUND(SUMIFS(Raw!$F$2:$F$1185,Raw!$E$2:$E$1185,B15,Raw!$D$2:$D$1185,C15,Raw!$A$2:$A$1185,ROW(Z$2010:Z$2021),Raw!$A$2:$A$1185,"<>2021")*10^6,)+ROW(Z$2010:Z$2021),)),10^4)
    The data is what i need, but the formula is pretty complicated for me, i would like to learn and try to understand, thank you so much!

+ 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] Formula to get the max record with condition
    By yllew in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-19-2021, 12:54 AM
  2. [SOLVED] Calculate how many times a record occurs in a year to date
    By Perk1961 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-22-2020, 05:15 PM
  3. [SOLVED] Duplicating record if condition is met?
    By ciapul12 in forum Excel General
    Replies: 8
    Last Post: 12-02-2018, 09:41 PM
  4. [SOLVED] Formula to extract the year from the date based on a condition ?
    By donny007 in forum Excel Formulas & Functions
    Replies: 29
    Last Post: 10-26-2018, 02:06 AM
  5. Add record in same line on basis of condition
    By sanjuss2 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-03-2015, 04:53 AM
  6. Skip to next record in For...Next Loop if condition not met
    By anandvh in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-22-2013, 04:12 PM
  7. Replies: 5
    Last Post: 10-26-2012, 05:43 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