+ Reply to Thread
Results 1 to 5 of 5

BYROW retrieve value in a dynamic array

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    09-15-2022
    Location
    Marseille, France
    MS-Off Ver
    O365 (PC) V 2303
    Posts
    265

    BYROW retrieve value in a dynamic array

    Dear friends:

    I need your help. I am trying to retrieve a cost value from a dynamic array, however I am stuck with my BYROW function. Not sure what I did wrong here.

    What I need, the cost which corresponds to the exact qty or the qty immediately below the requested quantity or, if it does not exist, the cost immediately above. The value would return "ALERT" il it does not exist.

    Any help is much appreciated on this matter, thanks.


    retrieve value by row.jpg
    Attached Files Attached Files

  2. #2
    Forum Contributor John Vergara's Avatar
    Join Date
    01-17-2022
    Location
    Colombia
    MS-Off Ver
    365
    Posts
    207

    Re: BYROW retrieve value in a dynamic array

    Hi to all!

    Try this formula instead:
    PHP Code: 
    =MAP(A5:A25,B5:B25,LAMBDA(id,qty,IF(COUNTIF(M5:M23,id),TAKE(TOCOL(XLOOKUP(qty,O5:O23/(M5:M23=id),Q5:Q23,,{-1,1}),2),1),"ALERT"))) 
    Blessings!

  3. #3
    Forum Contributor
    Join Date
    09-15-2022
    Location
    Marseille, France
    MS-Off Ver
    O365 (PC) V 2303
    Posts
    265

    Re: BYROW retrieve value in a dynamic array

    Thank You John it works great.

    I have a question. First time I see this kind of thing within an XLOOKUP function:

    XLOOKUP(qty,O5:O23/(M5:M23=id),Q5:Q23,,{-1,1})

    Is it some sort of a filter? Like the filter function but called with a "/" like a shortcut?

    Thank you.

  4. #4
    Forum Contributor John Vergara's Avatar
    Join Date
    01-17-2022
    Location
    Colombia
    MS-Off Ver
    365
    Posts
    207

    Re: BYROW retrieve value in a dynamic array

    Hi guillaume0314!

    The "/" sign is the math division. In this case, the division is between a range and a matrix (comparison between M column and each id). When M column match with the id, the comparison gives TRUE, otherwise FALSE.
    When you do a math operation with a logical value, it is converted to a equivalent value of 1 (if TRUE) or 0 (if FALSE). If TRUE, the number of column M is given, otherwise a #DIV/0! error. XLOOKUP ignores the error and
    make the lookup just with the numbers that accomplish the condition.

    I hope that the explanation helps you. Blessings!

  5. #5
    Forum Contributor
    Join Date
    09-15-2022
    Location
    Marseille, France
    MS-Off Ver
    O365 (PC) V 2303
    Posts
    265

    Re: BYROW retrieve value in a dynamic array

    Thank you for the details. I now understand the logic and I find this extremely powerful in order to filter data fast and easily prior to performing an XLOOKUP.

    Thanks a ton.

+ 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. Combine two working formulae using BYROW (or other function(s))
    By TMS in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-19-2023, 12:11 PM
  2. Replies: 4
    Last Post: 03-21-2023, 05:54 AM
  3. [SOLVED] BYROW(...LAMBDA(...) ) result in #CALC! error
    By dluhut in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-18-2022, 07:17 AM
  4. [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
  5. [SOLVED] How to retrieve a value from a dynamic range.
    By Blomen in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-12-2014, 08:23 AM
  6. Using Array in a row to retrieve specified field
    By kumatae in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-07-2013, 12:17 PM
  7. Way to retrieve values from a dynamic named range?
    By OLDWEASEL in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 06-08-2011, 09:53 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