+ Reply to Thread
Results 1 to 6 of 6

Dynamic Array Formula to get last three known services

  1. #1
    Forum Contributor
    Join Date
    09-04-2013
    Location
    USA
    MS-Off Ver
    Excel 365
    Posts
    263

    Dynamic Array Formula to get last three known services

    I am using a pre-Excel 365 formula to return the last three services a customer received. However, since I now have Excel 365, trying to figure out a dynamic array formula to make this easier to write. Have tried FILTER along with LARGE with no luck. Formula is as follows:

    Please Login or Register  to view this content.
    See attached sample Excel workbook.

    Any ideas? Thanks.
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: Dynamic Array Formula to get last three known services

    If the dates are always in ascending order per id, then try
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: Dynamic Array Formula to get last three known services

    Try:
    =LET(A,A2:D27,B,UNIQUE(INDEX(A,,2)),C,A1:D1,D,4,VSTACK(C,DROP(REDUCE("",B,LAMBDA(x,y,VSTACK(x,TAKE(FILTER(A,INDEX(A,,2)=y),-D)))),1)))

    To return a number OTHER than 4, change the bit in RED.
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: Dynamic Array Formula to get last three known services

    It can be made a bit simpler:

    =LET(A,A2:D27,B,UNIQUE(INDEX(A,,2)),C,A1:D1,D,4,REDUCE(C,B,LAMBDA(x,y,VSTACK(x,TAKE(FILTER(A,INDEX(A,,2)=y),-D)))))
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    09-04-2013
    Location
    USA
    MS-Off Ver
    Excel 365
    Posts
    263

    Re: Dynamic Array Formula to get last three known services

    Thanks. These will work

  6. #6
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: Dynamic Array Formula to get last three known services

    Glad to help & thanks 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] Need a formula to return an ARRAY prior to dynamic array functions - cannnot do it
    By RamJag in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-02-2022, 08:56 AM
  2. [SOLVED] COUNT Dynamic Array based on Date to return Dynamic Array Spill Range
    By dluhut in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-06-2022, 01:14 PM
  3. Array Formula with Dynamic Capabilities
    By covanpatten2 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 04-03-2019, 09:29 PM
  4. [SOLVED] Dynamic Formula Array
    By barrymac20 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-16-2019, 08:15 PM
  5. Replies: 1
    Last Post: 03-25-2016, 02:19 AM
  6. Dynamic Row Lookup Array within Array formula
    By OLLY-7 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-17-2014, 04:55 PM
  7. array formula with a dynamic range.
    By Dave in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-26-2006, 01:25 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