+ Reply to Thread
Results 1 to 26 of 26

Complicated row and column lookup

  1. #1
    Registered User
    Join Date
    12-20-2019
    Location
    Brazil
    MS-Off Ver
    2019
    Posts
    14

    Thumbs up Complicated row and column lookup

    The attached file explains the challenge well.
    It is a multiple lookup search offseting columns to the right and to the left based on 2 provided values.
    Hope can get your appreciated help.
    Attached Files Attached Files
    Last edited by 6StringJazzer; 05-23-2023 at 09:36 AM. Reason: Changed title from "I am trying to solve a finance question"

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

    Re: Complicated row and column lookup

    Are you still using Excel 2016?

  3. #3
    Registered User
    Join Date
    12-20-2019
    Location
    Brazil
    MS-Off Ver
    2019
    Posts
    14

    Re: Complicated row and column lookup

    It is Office 2019!
    Last edited by danibitter75; 05-23-2023 at 09:55 AM. Reason: Wrong answer

  4. #4
    Registered User
    Join Date
    12-20-2019
    Location
    Brazil
    MS-Off Ver
    2019
    Posts
    14

    Re: Complicated row and column lookup

    Sorry...it is Microsoft Office Professional Plus 2019 now.

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

    Re: Complicated row and column lookup

    Try,
    PHP Code: 
    =INDEX(INDEX($M$3:$AF$24,,MATCH($D$2,$M$1:$AF$1,0)),MATCH($D$4-MIN(FILTER($D$4-INDEX($M$3:$AF$24,,MATCH($D$2,$M$1:$AF$1,0)+2),$D$4-INDEX($M$3:$AF$24,,MATCH($D$2,$M$1:$AF$1,0)+2)>0)),INDEX($M$3:$AF$24,,MATCH($D$2,$M$1:$AF$1,0)+2),0)) 

  6. #6
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,448

    Re: Complicated row and column lookup

    For the members having XLOOKUP
    Formula: copy to clipboard
    Please Login or Register  to view this content.

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

    Re: Complicated row and column lookup

    Is XLOOKUP available in Excel 2019?

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

    Re: Complicated row and column lookup

    @danibitter75
    Please update your profile to reflect the current version of Excel. Folks here post solutions based upon the version you are using.
    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

  9. #9
    Registered User
    Join Date
    12-20-2019
    Location
    Brazil
    MS-Off Ver
    2019
    Posts
    14

    Re: Complicated row and column lookup

    Unfortunetely not available!

  10. #10
    Registered User
    Join Date
    12-20-2019
    Location
    Brazil
    MS-Off Ver
    2019
    Posts
    14

    Re: Complicated row and column lookup

    Ok..will do!

  11. #11
    Registered User
    Join Date
    12-20-2019
    Location
    Brazil
    MS-Off Ver
    2019
    Posts
    14

    Re: Complicated row and column lookup

    I have not a function called "FILTER"

  12. #12
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Complicated row and column lookup

    Hi Dani,

    I have a solution that takes 2 helper columns and a calculated min() cell. See the attached:
    ExcelForumfromDaniel.xlsx
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  13. #13
    Registered User
    Join Date
    12-20-2019
    Location
    Brazil
    MS-Off Ver
    2019
    Posts
    14

    Re: Complicated row and column lookup

    Quote Originally Posted by josephteh View Post
    Try,
    PHP Code: 
    =INDEX(INDEX($M$3:$AF$24,,MATCH($D$2,$M$1:$AF$1,0)),MATCH($D$4-MIN(FILTER($D$4-INDEX($M$3:$AF$24,,MATCH($D$2,$M$1:$AF$1,0)+2),$D$4-INDEX($M$3:$AF$24,,MATCH($D$2,$M$1:$AF$1,0)+2)>0)),INDEX($M$3:$AF$24,,MATCH($D$2,$M$1:$AF$1,0)+2),0)) 
    I have not the function "FILTER".

  14. #14
    Registered User
    Join Date
    12-20-2019
    Location
    Brazil
    MS-Off Ver
    2019
    Posts
    14

    Re: Complicated row and column lookup

    Quote Originally Posted by MarvinP View Post
    Hi Dani,

    I have a solution that takes 2 helper columns and a calculated min() cell. See the attached:
    Attachment 830310
    Worked really fine! Reputation added! Many thanks for your efforts and God bless you!

  15. #15
    Forum Expert
    Join Date
    09-25-2015
    Location
    Milan Italy
    MS-Off Ver
    office 365
    Posts
    1,783

    Re: Complicated row and column lookup

    D10=INDEX(INDEX(M$3:AF$24,,MATCH(D2&B10,$M$1:$AF$1&$M$2:$AF$2,0)),MATCH(AGGREGATE(14,6,INDEX(M$3:AF$24,,MATCH($D$2&$B$4,$M$1:$AF$1&$M$2:$AF$2,0))/(INDEX($M$3:$AF$24,,MATCH($D$2&$B$4,$M$1:$AF$1&$M$2:$AF$2,0))<=$D$4),1),INDEX($M$3:$AF$24,,MATCH($D$2&$B$4,$M$1:$AF$1&$M$2:$AF$2,0)),0))

    control+shift+enter
    Change your file like this
    Attached Files Attached Files

  16. #16
    Registered User
    Join Date
    12-20-2019
    Location
    Brazil
    MS-Off Ver
    2019
    Posts
    14

    Re: Complicated row and column lookup

    Quote Originally Posted by CARACALLA View Post
    D10=INDEX(INDEX(M$3:AF$24,,MATCH(D2&B10,$M$1:$AF$1&$M$2:$AF$2,0)),MATCH(AGGREGATE(14,6,INDEX(M$3:AF$24,,MATCH($D$2&$B$4,$M$1:$AF$1&$M$2:$AF$2,0))/(INDEX($M$3:$AF$24,,MATCH($D$2&$B$4,$M$1:$AF$1&$M$2:$AF$2,0))<=$D$4),1),INDEX($M$3:$AF$24,,MATCH($D$2&$B$4,$M$1:$AF$1&$M$2:$AF$2,0)),0))

    control+shift+enter
    Change your file like this
    Dear Caracalla, you have manipulated the original file. In my real life situation I cannot do that.

  17. #17
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Complicated row and column lookup

    Quote Originally Posted by danibitter75 View Post
    you have manipulated the original file. In my real life situation I cannot do that.
    Can you sort the data differently? The challenge of finding the next-smallest number can be greatly simplified if you do an ascending sort of the data in the "Of. Compra" columns.
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  18. #18
    Registered User
    Join Date
    12-20-2019
    Location
    Brazil
    MS-Off Ver
    2019
    Posts
    14

    Re: Complicated row and column lookup

    Quote Originally Posted by 6StringJazzer View Post
    Can you sort the data differently? The challenge of finding the next-smallest number can be greatly simplified if you do an ascending sort of the data in the "Of. Compra" columns.
    Cannot modify the original file as it is linked to other infos and these infos are dynamic changing using RTD external link.
    Last edited by danibitter75; 05-23-2023 at 12:54 PM. Reason: Add Info

  19. #19
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Complicated row and column lookup

    Can you use VBA?

  20. #20
    Registered User
    Join Date
    12-20-2019
    Location
    Brazil
    MS-Off Ver
    2019
    Posts
    14

    Re: Complicated row and column lookup

    Quote Originally Posted by 6StringJazzer View Post
    Can you use VBA?
    Yes...can be VBA.

  21. #21
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Complicated row and column lookup

    VBA solution with UDF attached. Function LookupAsset.
    Attached Files Attached Files

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

    Re: Complicated row and column lookup

    Hi to all!

    One option could be:
    PHP Code: 
    =LOOKUP(1,0/FREQUENCY(0,D4-INDEX(O3:AD24,,MATCH(D2,M1:AB1,))),INDEX(M3:AB24,,MATCH(D2,M1:AB1,))) 
    Check file. Blessings!
    Attached Files Attached Files
    A out-of-context text is a pretext.
    Consider adding reputation points to all the people who help you with your question/problem.

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

    Re: Complicated row and column lookup

    That's a brilliant formula, John! A rep for you!

  24. #24
    Registered User
    Join Date
    12-20-2019
    Location
    Brazil
    MS-Off Ver
    2019
    Posts
    14

    Re: Complicated row and column lookup

    Quote Originally Posted by John Vergara View Post
    Hi to all!

    One option could be:
    PHP Code: 
    =LOOKUP(1,0/FREQUENCY(0,D4-INDEX(O3:AD24,,MATCH(D2,M1:AB1,))),INDEX(M3:AB24,,MATCH(D2,M1:AB1,))) 
    Check file. Blessings!
    Nice and genius solution. Simple and light. Reputation deserved!

  25. #25
    Registered User
    Join Date
    12-20-2019
    Location
    Brazil
    MS-Off Ver
    2019
    Posts
    14

    Re: Complicated row and column lookup

    Many thanks!

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

    Re: Complicated row and column lookup

    Thanks for the kind words and rep, josephteh and danibitter75. Blessings!

+ 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. I am trying to solve a finance question
    By danibitter75 in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 05-24-2023, 10:15 AM
  2. Finance question - Interest calc on inconsistent cash flow
    By cornbread_r_square in forum Excel General
    Replies: 10
    Last Post: 05-24-2017, 04:42 AM
  3. Getting real time stock quotes from google finance / yahoo finance in excel
    By Navin Agrawal in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-21-2012, 12:41 PM
  4. solve Another Question
    By MJB10038 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-10-2007, 05:19 PM
  5. [SOLVED] Which Finance Function should i use to solve this
    By [email protected] in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-20-2006, 10:30 AM
  6. Replies: 1
    Last Post: 01-16-2006, 04:15 AM
  7. [SOLVED] try to solve Time Question
    By Arvi Laanemets in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-06-2005, 06:05 AM

Tags for this Thread

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