+ Reply to Thread
Results 1 to 9 of 9

Automatically fill cell in a colour if it has any date format in it

  1. #1
    Registered User
    Join Date
    03-20-2012
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    48

    Automatically fill cell in a colour if it has any date format in it

    Hi, Good Morning.

    I am trying to find a way to condition a group of cells so that if any date appears in a cell it changes to a colour (the colour initially is not important to me).

    I have searched hard in the conditional format settings but the date functions are predefined to fill the cell if it has todays date, yesterdays, past 7 past month etc. I have tried to write a formula but have not been successful.

    I am using 2007 but will need to be compatible with Excel 2003.

    Any help or ideas are very much appreciated. Thanks.

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Automatically fill cell in a colour if it has any date format in it

    Hi

    Do you use this column, only for dates?

    Or, also for text, or numbers?
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Registered User
    Join Date
    03-20-2012
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    48

    Re: Automatically fill cell in a colour if it has any date format in it

    Hi,

    Sorry for the delayed reply.

    When the cell needs to change colour I will put a date in. Before that it will have text in it and it will fill another colour. To clarify, when I put the date in the cell there will be no other numbers or text.

    Thanks.

  4. #4
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Automatically fill cell in a colour if it has any date format in it

    Hi

    If i understand well, you don't have numbers in this column.

    Then in Conditional Conditional rules, you can type something, like this.
    PHP Code: 
    =AND($A1<>"";$A1<TODAY()+150000
    If, you have numbers in this column, then this will not work.

    Hope that helps you.
    Attached Files Attached Files

  5. #5
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Automatically fill cell in a colour if it has any date format in it

    @ Fotis

    Doesn't this do the same thing?
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    03-20-2012
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    48

    Re: Automatically fill cell in a colour if it has any date format in it

    Thank you both for these formulas. I have tried them quickly and with a little work from me on the way I am inputting my data it may work.

    Unfortunately I have run out of time to continue trying this evening. However in the next day or so I shall find out. I will post again to let you know how I get on.

    Thank you very much again, have a good week.

  7. #7
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Automatically fill cell in a colour if it has any date format in it

    @Marcol

    ..Doesn't this do the same thing?
    Yes. does the same thing. Your suggestion It's much better and shorter and obviously (i)not thought of this. So ? What, you mean?

  8. #8
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Automatically fill cell in a colour if it has any date format in it

    Dates, potentially, mixed with numbers are never easy to handle and it is always better to avoid this scenario.

    Some restrictions can be added to limit the chances of "errors"
    e.g.
    Please Login or Register  to view this content.
    So any number greater than or equal to 36526, ("01/01/2000"), including decimal numbers can be read as a date.
    Similarly
    Please Login or Register  to view this content.
    restricts the range of numbers to 365265 > 43830.
    Obviously you can replace DATEVALUE("01/01/2000") with its' serial date, but this way is easier for others to read your intentions.

    Data Validation can also help to control this situation.
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  9. #9
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Automatically fill cell in a colour if it has any date format in it

    Aha...Yes. You're right.

    Just cleaver! I'll keep it, in my mind.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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