+ Reply to Thread
Results 1 to 9 of 9

Vlookup to look up value for Previous Day in Col F

  1. #1
    Forum Contributor
    Join Date
    07-12-2018
    Location
    South Africa
    MS-Off Ver
    Office 2021
    Posts
    2,723

    Vlookup to look up value for Previous Day in Col F

    I have a dates in Col D and want to lookup the value in Col F for todays date - 1 i.e. previous date


    I have tried to set this up , but get an error


    I have attached sample data


    It would be appreciated if someone could kindly assist me
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,831

    Re: Vlookup to look up value for Previous Day in Col F

    1. First issue - the dates you have in the file are not just dates, but a date and time. Change them to just dates.
    2. Formula in B1 can be either:

    =INDEX(F2:F16,MATCH(TODAY()-1,D2:D16,0))
    or
    =VLOOKUP(TODAY()-1,$D$1:F21,3,FALSE)

  3. #3
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Vlookup to look up value for Previous Day in Col F

    If you want to keep same format for date-time, try:
    Please Login or Register  to view this content.
    Note: If yesterday was missing, the LOOKUP with returns the value of newest day from yesterday (nth day before yesterday)
    Quang PT

  4. #4
    Forum Contributor
    Join Date
    07-12-2018
    Location
    South Africa
    MS-Off Ver
    Office 2021
    Posts
    2,723

    Re: Vlookup to look up value for Previous Day in Col F

    Thanks for the help Guys. Formula works perfectly

    The Range in Col D & F changes each day

    I tried to record the code, and then to amend it so that it pick up the last row -1, but cannot get it to work


    Please Login or Register  to view this content.
    It would be appreciated if you could assist me
    Attached Files Attached Files

  5. #5
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,831

    Re: Vlookup to look up value for Previous Day in Col F

    You can extend the formula, like:

    =INDEX(F2:F160000,MATCH(TODAY()-1,D2:D160000,0))

    In fact, you could just do the whole column:

    =INDEX(F:F,MATCH(TODAY()-1,D:D,0))

  6. #6
    Forum Contributor
    Join Date
    07-12-2018
    Location
    South Africa
    MS-Off Ver
    Office 2021
    Posts
    2,723

    Re: Vlookup to look up value for Previous Day in Col F

    Thanks Greg. I now get #N/A


    I have attached my sample data
    Attached Files Attached Files

  7. #7
    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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,820

    Re: Vlookup to look up value for Previous Day in Col F

    Try an approximate match on TODAY():

    =INDEX(F:F,MATCH(TODAY(),D:D,1))
    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.

  8. #8
    Forum Contributor
    Join Date
    07-12-2018
    Location
    South Africa
    MS-Off Ver
    Office 2021
    Posts
    2,723

    Re: Vlookup to look up value for Previous Day in Col F

    Thanks ALI


    Formula works perfectly

  9. #9
    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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,820

    Re: Vlookup to look up value for Previous Day in Col F

    People often forget about the approximate match setting.

+ 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. vlookup to return value based on previous months
    By janjmi in forum Excel General
    Replies: 2
    Last Post: 03-26-2020, 11:45 AM
  2. [SOLVED] VLOOKUP - skip previous result
    By TomBP in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-19-2017, 05:59 AM
  3. How to VLOOKUP excluding a previous result
    By Marceltcm in forum Excel General
    Replies: 8
    Last Post: 09-14-2016, 01:22 AM
  4. [SOLVED] Vlookup and returning previous months data
    By sevanseriesta in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 08-25-2015, 03:28 PM
  5. Vlookup skipping previous results
    By J_Le4 in forum Excel General
    Replies: 1
    Last Post: 11-22-2011, 10:34 PM
  6. Vlookup displaying previous entry
    By Dylan87 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-11-2010, 04:21 AM
  7. Replies: 1
    Last Post: 07-30-2009, 05:54 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