+ Reply to Thread
Results 1 to 9 of 9

Highlight row if date in column is passed.

  1. #1
    Registered User
    Join Date
    07-10-2014
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    14

    Highlight row if date in column is passed.

    Hi,

    I want to highlight the rows in my worksheet when the dates in column 'N' are in the past. I've seen codes to do this using conditional formatting when searching online and in here but the problem is is that it highlights blank cells as well. Is it possible to correct this?

    Thanks!

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Highlight row if date in column is passed.

    So you don't want it to highlight any blank cells in that row? or you don't want it to highlight a row if column N is blank?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Highlight row if date in column is passed.

    Let's say your data is in A2:Z450, select those cells
    Go to Conditional Formatting>New Rule>Use Formula

    =AND(ISNUMBER($N2), $N2< TODAY())

    Does that work for you?

  4. #4
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: Highlight row if date in column is passed.

    Give this small macro a try:

    Please Login or Register  to view this content.
    Gary's Student

  5. #5
    Registered User
    Join Date
    07-10-2014
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    14

    Re: Highlight row if date in column is passed.

    Hi guys,

    Thanks so much for your responses but the solutions don't seem to be working :S. I'll attach the sheet. So if a date in the 'Loan Return' column is in the past, I want that whole row to be highlighted. I want this to happen to new data that I will be continually putting in. The problem I had before was that it seemed to highlight everything.

    Thanks
    Attached Files Attached Files

  6. #6
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: Highlight row if date in column is passed.

    The problem is dates in col. N. These are dates stored as text not numbers as excel treats dates as serial numbers. So in this case select the range A3:Q5 and make a New Rule for conditional formatting using the formula given below and set format as per your choice.

    Please Login or Register  to view this content.
    Does this help?
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  7. #7
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Highlight row if date in column is passed.

    Your dates are Text and not true dates (which are numbers). They need to be entered as dates. I selected A3:Q5000 and used my formula. See attached.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    07-10-2014
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    14

    Re: Highlight row if date in column is passed.

    Hi Chemist! How do I add them as true dates for future reference? Cheers. Thanks for doing that it is exactly what I wanted.

  9. #9
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Highlight row if date in column is passed.

    Are you importing this data or entering it manually?

    If importing, it might be better to just use sktneer's formula in the conditional formatting.

    Otherwise, in a new column (which you can hide if you like)
    =DATEVALUE(SUBSTITUTE(N3,".","/"))
    Cell must be formatted as a date for it to look like a date.

    You can then reference this new column instead of Column N or you could

    Copy>Paste Special > Values into Column N
    Last edited by ChemistB; 08-01-2014 at 01:02 PM.

+ 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. highlight passed due invoice dates
    By Loveabull in forum Excel General
    Replies: 1
    Last Post: 02-18-2013, 02:02 PM
  2. Replies: 3
    Last Post: 11-23-2012, 03:52 PM
  3. Column Protect if Current Date is Passed
    By Abdul Haneef in forum Excel Programming / VBA / Macros
    Replies: 28
    Last Post: 06-13-2012, 11:30 AM
  4. Date passed = Highlight
    By simon3163 in forum Excel General
    Replies: 6
    Last Post: 11-17-2010, 05:28 PM
  5. read date and highlight if a month passed
    By pelachrum in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-28-2006, 10:22 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