+ Reply to Thread
Results 1 to 19 of 19

Before and after tp location

  1. #1
    Registered User
    Join Date
    11-26-2019
    Location
    Thane
    MS-Off Ver
    2021
    Posts
    42

    Before and after tp location

    Dear Experts,

    Please see my attached excel file I required crossing before and after TP No.


    CROSSINGS TP LOCATION.xlsx

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,151

    Re: Before and after tp location

    In G3

    =INDEX($A$3:$A$23,MATCH($H3,$B$3:$B$23,1))

    in I3

    =INDEX($A$3:$A$23,MATCH($J3,$B$3:$B$23,1))
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  3. #3
    Registered User
    Join Date
    11-26-2019
    Location
    Thane
    MS-Off Ver
    2021
    Posts
    42

    Re: Before and after tp location

    Thank you for your reply, @JohnTopley.

    I think I have caused some confusion. What I actually want is to find crossings before and after the TP number. Your formula returns results based on column H, but please note that columns H and J do not exist in my Excel sheet.

  4. #4
    Registered User
    Join Date
    11-26-2019
    Location
    Thane
    MS-Off Ver
    2021
    Posts
    42

    Re: Before and after tp location

    please see attached file
    Attached Files Attached Files

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,151

    Re: Before and after tp location

    Use the same formula but match against the "Chainage" value in column E rather than the "TP" value

    See attached
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    11-26-2019
    Location
    Thane
    MS-Off Ver
    2021
    Posts
    42

    Re: Before and after tp location

    Please see the revised excel file.
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,151

    Re: Before and after tp location

    You have a reply on this in Post #5

  8. #8
    Registered User
    Join Date
    11-26-2019
    Location
    Thane
    MS-Off Ver
    2021
    Posts
    42

    Re: Before and after tp location

    Sorry for the late reply. I tried using the fifth solution, but it gave me the correct answer before TP, but the result after TP was wrong.

  9. #9
    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
    43,984

    Re: Before and after tp location

    Hi.

    Is your forum profile showing the Excel PRODUCT that you need this request to work with? With XLOOKUP, you are NOT using Excel 2013.

    The best solutions often rely on knowing WHICH Office PRODUCT (Excel, NOT Windows) that you have. Please check that your forum profile is up-to-date. If you aren't sure, in Excel go to File/Account and report what it says below the MS logo at the top of that page. If your version is for Mac, please also state this.

    The three most recent Excel PRODUCTS are Excel 2019, Excel 2021 and MS365 - if you are using MS365, please give this name along with the Version number in your profile (e.g. MS365 (PC) Version 2211). The version number is in the About Excel section further down the Account page.

    Cheers,

    Glenn.
    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

  10. #10
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,151

    Re: Before and after tp location

    The results in the file in post #5 match your manual results so formula is not going to error in another file.

  11. #11
    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
    43,984

    Re: Before and after tp location

    IF you have O365, delete ALL expected result and use...

    =LET(A,A3:A23,B,B3:B23,E,E3:E8,HSTACK(BYROW(E,LAMBDA(x,TAKE(FILTER(A,B<=x),-1))),BYROW(E,LAMBDA(x,TAKE(FILTER(A,B>=x),1)))))

    no copy paste.
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    11-26-2019
    Location
    Thane
    MS-Off Ver
    2021
    Posts
    42

    Re: Before and after tp location

    Thanks, Glenn Kennedy. Based on your Excel file, the result is correct. However, I do not have Office 365; instead, I have Office 2021. When I try to drag the formula, I receive a #NAME? error.

  13. #13
    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
    43,984

    Re: Before and after tp location

    It will not work in Excel 2021. Give me a few minutes. While I am looking at it... pleas eupdate your profile.

  14. #14
    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
    43,984

    Re: Before and after tp location

    Try:

    =INDEX(A:A,AGGREGATE(14,6,ROW($B$3:$B$23)/($B$3:$B$23<=E3),1))

    and

    =INDEX(A:A,AGGREGATE(15,6,ROW($B$3:$B$23)/($B$3:$B$23>=E3),1))

    both copied down.
    Attached Files Attached Files

  15. #15
    Registered User
    Join Date
    11-26-2019
    Location
    Thane
    MS-Off Ver
    2021
    Posts
    42

    Re: Before and after tp location

    Thank You, according to your formula result is correct.


  16. #16
    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
    43,984

    Re: Before and after tp location

    I've asked you to update your profile. Please do so... you'll get pestered to check your profile endlessly... if your Excel product looks a biy elderly.

  17. #17
    Registered User
    Join Date
    11-26-2019
    Location
    Thane
    MS-Off Ver
    2021
    Posts
    42

    Re: Before and after tp location

    Okay, I have Updated My profile.

    Thanks For the Info.

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

    Re: Before and after tp location

    If you are using Excel 2021, then you can use the XLOOKUP function.

    BEFORE TP =XLOOKUP($E3,$B$3:$B$23,$A$3:$A$23,,-1,1)
    AFTER TP =XLOOKUP($E3,$B$3:$B$23,$A$3:$A$23,,1,-1)

  19. #19
    Registered User
    Join Date
    11-26-2019
    Location
    Thane
    MS-Off Ver
    2021
    Posts
    42

    Re: Before and after tp location

    Thank You, according to your formula result is correct.


+ 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. Scan barcode , Split by order/location and Check by location
    By tristancristian in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-15-2023, 10:51 AM
  2. Mac excel 2016, vba copy file from one location to sandbox location
    By sujithy007 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-11-2016, 12:01 PM
  3. [SOLVED] Macro to Save Excel File to a SharePoint location and then e-mail that location in Outlook
    By NickyHavey in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-11-2016, 09:27 AM
  4. Moving *.xlsx from current location including Sub Folders to another location
    By mvinay in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-02-2014, 03:55 AM
  5. Code that works in one location but not another location. (AdvancedFilter excel function)
    By 111StepsAhead in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-29-2013, 02:18 PM
  6. [SOLVED] [Help]macro to open file browser, to select a location, and save the location to a cell
    By zhuleijia in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-06-2013, 09:56 AM
  7. Replies: 1
    Last Post: 10-31-2012, 11:19 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