+ Reply to Thread
Results 1 to 9 of 9

Displaying wrong result while using Let function

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    03-11-2011
    Location
    Nepal
    MS-Off Ver
    MS Excel 365
    Posts
    1,255

    Displaying wrong result while using Let function

    Hi,
    I have used LET function in B5 but showi wrong result.My expected results are mentioned in F5:G8.

    Couldn't figure out what is missing.
    Attached Files Attached Files

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

    Re: Displaying wrong result while using Let function

    worksheet or Tab name : Result

    Cell B5 formula

    Formula: copy to clipboard
    =LET(z,Data!A4:C11,l,A5:A8,FILTER(FILTER(SORTBY(z,MATCH(INDEX(z,,1),l,)),SEQUENCE(ROWS(z))<=ROWS(l)),{0,1,1}))

  3. #3
    Forum Contributor
    Join Date
    03-11-2011
    Location
    Nepal
    MS-Off Ver
    MS Excel 365
    Posts
    1,255

    Re: Displaying wrong result while using Let function

    Thanx for the reply.
    Can you exclude SORTBY function from above LET function.What it should be without it without any change in the result ?

    Also,trying to use something like below function
    XLOOKUP(A5:A8,Data!A4:A11,Data!B4:C11,0)
    in it.

    Is it possible.

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

    Re: Displaying wrong result while using Let function

    Please try

    =INDEX(Data!B4:C11,MATCH(A5:A8,Data!A4:A11,),{1,2})
    Attached Files Attached Files
    Last edited by Bo_Ry; 08-02-2022 at 01:37 AM.

  5. #5
    Forum Contributor
    Join Date
    03-11-2011
    Location
    Nepal
    MS-Off Ver
    MS Excel 365
    Posts
    1,255

    Re: Displaying wrong result while using Let function

    That seems to work.

    I would like to ask one more thing.The lookup value (A5:A8) in my actual workbook is actually is extracted using something
    TEXTJOIN(, 1, TEXT(MID(D6, ROW($D$6:INDEX($D$6:$D$969, LEN(D6))), 1), "#;-#;0;"))
    When I use your formula,it gives #N/A Error.But when I copy paste and make it hardcoded and then converted into number then your formula works very fine.
    Is,I need to wrap up by some other formula in it.

    Kindly suggest me.How to resolve this kind of issue.

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,668

    Re: Displaying wrong result while using Let function

    Try using just this bit:

    TEXT(MID(D6, ROW($D$6:INDEX($D$6:$D$969, LEN(D6))), 1), "#;-#;0;")

    with the double unury:

    --TEXT(MID(D6, ROW($D$6:INDEX($D$6:$D$969, LEN(D6))), 1), "#;-#;0;")

    So you'll end up with this:

    =INDEX(Data!B4:C11,MATCH(--TEXT(MID(D6, ROW($D$6:INDEX($D$6:$D$969, LEN(D6))), 1), "#;-#;0;"),Data!A4:A11,),{1,2})

    Any good?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  7. #7
    Forum Contributor
    Join Date
    03-11-2011
    Location
    Nepal
    MS-Off Ver
    MS Excel 365
    Posts
    1,255

    Re: Displaying wrong result while using Let function

    I have used below as per your Post #6 in my real working workbook.

    INDEX(Data!B4:C1604,MATCH(--TEXT(MID(D6, ROW($D$6:INDEX($D$6:$D$969, LEN(D6))), 1), "#;-#;0;"),Data!A4:A1604,),{1,2})
    It is displaying error as #VALUE!.

    I think I have to go by converting into number by doing hardcoded which is working very fine.
    Last edited by paradise2sr; 08-02-2022 at 03:02 AM.

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,668

    Re: Displaying wrong result while using Let function

    Hard to say without seeing the workbook, but I see you've marked this as solved.

  9. #9
    Forum Contributor
    Join Date
    03-11-2011
    Location
    Nepal
    MS-Off Ver
    MS Excel 365
    Posts
    1,255

    Re: Displaying wrong result while using Let function

    Yes,marked it solved as in hardcoded number it works.

    As I cannot disclose in publicly the workbook.But to let you know, that the number is extracted from other columns using as mentioned above function namely TextJoin and this is the lookup value.
    Rest is the remaining story as stated above.

+ 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. Using the IF function, but displaying the result of a formula
    By CanadaMoose in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-30-2016, 07:47 PM
  2. Displaying wrong result on SUMIFS due to space in left
    By paradise2sr in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 03-14-2016, 10:00 PM
  3. [SOLVED] Using Offset function as the array in the PercentRank function is giving wrong result
    By Bobneil in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 08-06-2013, 09:29 PM
  4. Wrong result displaying using IFERROR-INDEX-MATCH-ROW Formula
    By paradise2sr in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 07-16-2013, 01:03 PM
  5. Result wrong in the month function
    By folsieski in forum Excel General
    Replies: 2
    Last Post: 04-04-2011, 08:23 AM
  6. Excel 2007 : Wrong Result of Function PMT
    By owais.akber in forum Excel General
    Replies: 1
    Last Post: 01-10-2011, 11:26 PM
  7. IF function giving wrong result
    By dzorug in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-23-2005, 11:41 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