+ Reply to Thread
Results 1 to 5 of 5

VLOOKUP - retain date for conditional formatting?

Hybrid View

  1. #1
    Forum Contributor NewYears1978's Avatar
    Join Date
    03-15-2010
    Location
    Forney, TX
    MS-Off Ver
    Excel 2016
    Posts
    962

    VLOOKUP - retain date for conditional formatting?

    I have two sheets, sheet1 pulls data from sheet2.

    One column is a date but of course vlookup just inputs it as a number. I use conditional formatting ont his column to highlight based on certain dates...but of course this breaks with VLOOKUP.

    I am not sure how to do this if it is even possible.
    I have tried

    =VLOOKUP(A2,New!A:P,12,FALSE)
    =TEXT(VLOOKUP(A2,New!A:P,12,FALSE),"dd mm yyyy")
    Also formatting the column as a date doesn't have any effect.

    Any ideas?

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,977

    Re: VLOOKUP - retain date for conditional formatting?

    Is it possible that the data found by VLOOKUP is actually text? Text would not be affected by formatting or the TEXT function that you showed.

    I think it would help if you attach your file.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Contributor NewYears1978's Avatar
    Join Date
    03-15-2010
    Location
    Forney, TX
    MS-Off Ver
    Excel 2016
    Posts
    962

    Re: VLOOKUP - retain date for conditional formatting?

    Possibly. The Sheet2 is exported from our system in pure text format..but I tried changing those to dates on that file..which worked. It is really confusing - I will attach sheet. It is column O I am referring to. (last sale)

    (I had to remove most the data from sheet2 to get under the filesize limit FYI)

    I think based on what you just said I found a solution.

    I will add a new column next to my date column and use =Value() then format that as a date. This should work! I will then just hide the other column.
    Attached Files Attached Files
    Last edited by NewYears1978; 07-21-2017 at 02:19 PM.

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,977

    Re: VLOOKUP - retain date for conditional formatting?

    I think you have a workable solution. The numbers on sheet New are text. One way to tell this is that the string is left-justified. Numbers and dates are right-justified by default. This is a very common issue with date exported from other applications.

  5. #5
    Forum Contributor NewYears1978's Avatar
    Join Date
    03-15-2010
    Location
    Forney, TX
    MS-Off Ver
    Excel 2016
    Posts
    962

    Re: VLOOKUP - retain date for conditional formatting?

    Yeah - thank you. I will try my method and see if I can't work it out. Now I have the next issue which is something else so I will post a new thread.

+ 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. Formatting Cells with Date or Text Values in a Conditional Formatting Formula
    By Phil Hageman in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-15-2014, 09:36 AM
  2. Concatenate Values | Retain Conditional Formatting of the Source
    By jcanlas in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-12-2013, 04:58 PM
  3. Replies: 3
    Last Post: 11-11-2012, 01:27 AM
  4. VBA to Retain the Conditional Formatting with an Advanced Filter
    By mmctague in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-12-2012, 02:09 PM
  5. Replies: 1
    Last Post: 08-16-2012, 10:51 AM
  6. Retain conditional formatting when pasting new data into cells, and how to copy it
    By NatGunod in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-03-2012, 10:27 AM
  7. Merge mixed data - retain date/time formatting
    By symaxf in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-07-2011, 03:08 PM

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