+ Reply to Thread
Results 1 to 10 of 10

Help with Excel lookup formula please

  1. #1
    Registered User
    Join Date
    01-23-2019
    Location
    johannesburg, southafrica
    MS-Off Ver
    2010
    Posts
    5

    Help with Excel lookup formula please

    Please sir / Madam,

    I need urgent help with the below;

    I have two tables. I want to be able to search for the ID from a lookup table and return the one that closely matches the date and time of the main table.

    Please see sample tables below;

    Main table

    ID Date time Vlookup Value
    1035 3/14/2021 20:51:56
    1035 3/19/2021 18:30:54 3/19/2021 20:51:56
    1090 3/14/2021 18:24:19
    1090 3/14/2021 17:58:31



    Vlookup Table


    id Vlookup Value
    1035 3/19/2021 20:51:56
    Please help thanks;
    Last edited by chytechp; 05-17-2021 at 01:29 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    05-15-2017
    Location
    US
    MS-Off Ver
    365
    Posts
    901

    Re: Urgent Help with Excel lookup formula please

    Can you provide a sample file.. that shows what you expect to get back?

    Are you asking to search your Main table using the VLOOKUP table value and have it return which one? are you wanting to search based on date and return the ID that has the closest match to that date/time?

    What if there are 2 id's that are close matches? which do you prefer returned? is there a threshold you are ok with? meaning how much time (minutes/seconds or hours) do they have to be within to be considered a match and return?
    If you find the suggestion or solution helpful, please consider adding reputation to the post.

  3. #3
    Registered User
    Join Date
    01-23-2019
    Location
    johannesburg, southafrica
    MS-Off Ver
    2010
    Posts
    5

    Re: Urgent Help with Excel lookup formula please

    I have attached the excel file.

    So with VLOOKUP(C5,B12:B12,1,TRUE) am able to get the datetime closest the value am looking for. But i want to be able to also make it consider the ID. to be sure i return the exact result.
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor
    Join Date
    05-15-2017
    Location
    US
    MS-Off Ver
    365
    Posts
    901

    Re: Urgent Help with Excel lookup formula please

    You could try =XLOOKUP(B12,B4:B7,A4:B7,"NA",-1)

    This would return the ID and date that is closest to the date provided.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,933

    Re: Urgent Help with Excel lookup formula please

    Don't tell us that it is URGENT, please. To you it may be, but to us it isn’t. If it’s urgent, you should be calling on a consultant, not a volunteer who is giving their free time.
    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. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  6. #6
    Registered User
    Join Date
    01-23-2019
    Location
    johannesburg, southafrica
    MS-Off Ver
    2010
    Posts
    5

    Re: Help with Excel lookup formula please

    Thanks AliGw. I have edited the title.

  7. #7
    Registered User
    Join Date
    01-23-2019
    Location
    johannesburg, southafrica
    MS-Off Ver
    2010
    Posts
    5

    Re: Urgent Help with Excel lookup formula please

    Thanks Cubangt, this is very close.

  8. #8
    Valued Forum Contributor
    Join Date
    05-15-2017
    Location
    US
    MS-Off Ver
    365
    Posts
    901

    Re: Urgent Help with Excel lookup formula please

    Quote Originally Posted by chytechp View Post
    Thanks Cubangt, this is very close.
    is there something its not returning or not as expected?

  9. #9
    Registered User
    Join Date
    01-23-2019
    Location
    johannesburg, southafrica
    MS-Off Ver
    2010
    Posts
    5

    Re: Help with Excel lookup formula please

    I want it to return the datetime that is closest to one on the main table and not the ID. It will be great if it can be tweaked.

  10. #10
    Valued Forum Contributor
    Join Date
    05-15-2017
    Location
    US
    MS-Off Ver
    365
    Posts
    901

    Re: Help with Excel lookup formula please

    All you would need to do is change it to this;

    =XLOOKUP(B12,B4:B7,B4:B7,"NA",-1)

+ 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. Urgent help with excel formula
    By SariM in forum Excel General
    Replies: 2
    Last Post: 05-05-2017, 04:00 AM
  2. Urgent need help for excel formula
    By kumar.vinod82 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-08-2015, 09:07 AM
  3. Urgent need help for excel formula
    By kumar.vinod82 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-08-2015, 03:06 AM
  4. Urgent need help to solve excel formula
    By kumar.vinod82 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-08-2015, 03:05 AM
  5. [SOLVED] urgent help please! year statistics with excel formula
    By mavi99 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-28-2014, 11:05 PM
  6. Replies: 1
    Last Post: 09-23-2013, 07:50 PM
  7. Urgent - how to set a formula in excel spreadsheet
    By Calculate Date range in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-20-2006, 09:25 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