+ Reply to Thread
Results 1 to 4 of 4

Expert Required: How to display the values of a date or the next earliest date

  1. #1
    Registered User
    Join Date
    01-09-2015
    Location
    toronto, Canada
    MS-Off Ver
    2010
    Posts
    45

    Lightbulb Expert Required: How to display the values of a date or the next earliest date

    excel help.xlsxHi All,

    Im trying to find a way so that if a date isnt available in a table that it would then show the next earliest date.

    I have attached a spreadsheet to better display what I am trying to achieve

    When the date I am trying to Vlookup doesnt exist in the raw data I want it to display the next earliest date (I.e Vlookup Value: Dec 10. If December 10th doesnt exist in the raw data I want it to display Dec 8th which does)

    You will notice that under two of the dates it displays an error this is because those dates dont exist on the raw data

    Thank you

  2. #2
    Registered User
    Join Date
    01-09-2015
    Location
    toronto, Canada
    MS-Off Ver
    2010
    Posts
    45

    Re: Expert Required: How to display the values of a date or the next earliest date

    Here is a picture of how the spreadsheets looks for those who dont want to download the workbook

    Capture1.PNG

    Capture.PNG

  3. #3
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Expert Required: How to display the values of a date or the next earliest date

    Try =VLOOKUP(D3,Sheet2!$A$2:$B$83,2,1) instead of =VLOOKUP(D3,Sheet2!$A$2:$B$83,2,0)
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  4. #4
    Valued Forum Contributor Sean Thomas's Avatar
    Join Date
    03-25-2012
    Location
    HerneBay, Kent, UK
    MS-Off Ver
    Excel 2007,2016
    Posts
    971

    Re: Expert Required: How to display the values of a date or the next earliest date

    you need to change the date Dec-13 to text then use =VLOOKUP(DATEVALUE(D3),Sheet2!$A$2:$B$83,2,1)
    Regards
    Sean

    Please add to my reputation if you think i helped
    (click on the star below the post)
    Mark threads as "Solved" if you have your answer
    (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code:
    [code] Your code here [code]
    Please supply a workbook containing example Data:
    It makes its easier to answer your problem & saves time!

+ 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. [SOLVED] Count Unique Values Based on Earliest Date Criteria
    By Aquamore in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-04-2014, 09:12 PM
  2. Find the earliest date within comma-separated values
    By Niclal in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-14-2014, 10:08 AM
  3. [SOLVED] Access Query: Need unique values and earliest date.
    By AlphaSkidz in forum Access Tables & Databases
    Replies: 18
    Last Post: 02-09-2014, 07:41 AM
  4. extract earliest date from array for list of known values
    By dungeon_master in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-16-2012, 08:44 AM
  5. Pivot Automation: Remove earliest date and add 1 date (Rows)
    By 4am in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-03-2011, 04:50 PM

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