+ Reply to Thread
Results 1 to 5 of 5

VLOOKUP FAILS ON dd/mm/yyyy hh:mm FORMAT

  1. #1
    Forum Contributor
    Join Date
    10-07-2015
    Location
    cyprus
    MS-Off Ver
    Microsoft 365
    Posts
    182

    VLOOKUP FAILS ON dd/mm/yyyy hh:mm FORMAT

    in the attached table, cell C5 should return the relevant value of A1:A3 if B5 equals any value from B1:B3.

    All date are formatted as "dd/mm/yyyy hh:mm" and i tried to round it too without any success.

    Can someone give me the trick?
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    04-30-2015
    Location
    The Netherlands
    MS-Off Ver
    office 365
    Posts
    195

    Re: VLOOKUP FAILS ON dd/mm/yyyy hh:mm FORMAT

    Hey there,

    The problem is not related to the time format, it is the fact that you have the value you are looking up in the second column, Vlookup doesn't like this. The quick fix is swapping the 3 dates in the b column with the 3 activities in the a column. Otherwise you might want to use another formula, but not Vlookup.

    The workbook is attached with the quick fix.

    Ferdy
    Attached Files Attached Files

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

    Re: VLOOKUP FAILS ON dd/mm/yyyy hh:mm FORMAT

    try
    =VLOOKUP(B5,CHOOSE({1,2},B1:B3,A1:A3),2,FALSE) or
    =INDEX(A1:A3,MATCH(B5,B1:B3,0))

    in VLookup lookup value should always be in the first column in the range (Table_array)
    in your case it lookup value is in second column of the selected range, thats why it is giving an error value
    Samba

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

  4. #4
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2021
    Posts
    5,931

    Re: VLOOKUP FAILS ON dd/mm/yyyy hh:mm FORMAT

    Try this:

    =INDEX($A$1:$A$3,MATCH(B5,$B$1:$B$3,0))

  5. #5
    Forum Contributor
    Join Date
    10-07-2015
    Location
    cyprus
    MS-Off Ver
    Microsoft 365
    Posts
    182

    Re: VLOOKUP FAILS ON dd/mm/yyyy hh:mm FORMAT

    found it

    =INDEX(A1:A3,MATCH(B5,B1:B3))

+ 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. Convert Date format from Text format reading m/d/yyyy to dd/mm/yyyy
    By bridge4444 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-23-2017, 11:22 PM
  2. Replies: 35
    Last Post: 06-21-2017, 09:56 PM
  3. Help require to change a year format to custom yyyy-yyyy format
    By mso3 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 02-23-2015, 01:04 AM
  4. Replies: 8
    Last Post: 10-02-2013, 06:23 PM
  5. Replies: 7
    Last Post: 11-18-2012, 02:28 PM
  6. [SOLVED] Imported data contains strings dd.mm.yyyy how can I convert to date format dd/mm/yyyy inVB
    By Boormo in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-05-2012, 05:48 PM
  7. [SOLVED] opening excel file -> date format problem: DD/MM/YYYY vs MM/DD/YYYY
    By yung in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-18-2005, 09:06 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