+ Reply to Thread
Results 1 to 14 of 14

excel if/then functions with dates and colour

  1. #1
    Registered User
    Join Date
    11-07-2012
    Location
    The Hague
    MS-Off Ver
    Excel 20037
    Posts
    10

    excel if/then functions with dates and colour

    Hello, this will be mine first post on this forum, and I think not the last one.

    The following is driving me crazy.
    I have a spreadsheet that shows the planning and availability of demo systems for a whole year.
    There is a start date (cell A2) and an end date (cell B2) that I manual type in.
    In Row 1 from cell C1 - IV1) I have all the dates of one year.
    If I fill out the dates I colour the cells in the row manual.

    Now I am looking for a formula that colours these cells automatic when I type in the dates.

    Thanks.

    Prins
    Last edited by Prins; 11-07-2012 at 09:47 AM.

  2. #2
    Registered User
    Join Date
    10-29-2012
    Location
    hyderabad, India
    MS-Off Ver
    Excel 2007
    Posts
    53

    Re: excel if/then functions with dates and colour

    hi,

    why don't you use conditional formatting?

  3. #3
    Registered User
    Join Date
    11-07-2012
    Location
    The Hague
    MS-Off Ver
    Excel 20037
    Posts
    10

    Re: excel if/then functions with dates and colour

    I have tried that, but not working. Could be that I am doing something wrong.
    Last edited by Prins; 11-07-2012 at 10:12 AM.

  4. #4
    Registered User
    Join Date
    10-29-2012
    Location
    hyderabad, India
    MS-Off Ver
    Excel 2007
    Posts
    53

    Re: excel if/then functions with dates and colour

    can you upload a sample sheet..

  5. #5
    Registered User
    Join Date
    11-07-2012
    Location
    The Hague
    MS-Off Ver
    Excel 20037
    Posts
    10

    Re: excel if/then functions with dates and colour

    I gave you one part of the totall sheet.
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    11-05-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    229

    Re: excel if/then functions with dates and colour

    Hi Prins,

    I saw your sheet... I think conditional formatting with the formula =AND(N$3>=$B6,N$3<=$C6) will work.
    You will have to change the dates in row 3. They are showing 1st Jan 1900 onwards, so you can't compare them with dates in 2013.

    Don't forget to click the little star next to this post if you feel I helped.
    Taming the Excel dragon... www.TheExcelphile.com

  7. #7
    Registered User
    Join Date
    11-07-2012
    Location
    The Hague
    MS-Off Ver
    Excel 20037
    Posts
    10

    Re: excel if/then functions with dates and colour

    Quote Originally Posted by TheExcelphile View Post
    Hi Prins,

    I saw your sheet... I think conditional formatting with the formula =AND(N$3>=$B6,N$3<=$C6) will work.
    You will have to change the dates in row 3. They are showing 1st Jan 1900 onwards, so you can't compare them with dates in 2013.

    Don't forget to click the little star next to this post if you feel I helped.

    I tried you option but not working.
    I changed the date format, but I am wondering if I am not clearly understand how to do this with conditional formating.

  8. #8
    Forum Contributor
    Join Date
    11-05-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    229

    Re: excel if/then functions with dates and colour

    I've done the conditional formatting for you in this file... Copy of Sample sheet-1.xlsx

    And, it wasn't just the format of the dates in row 3 that was the problem. You have to change the year from 1900 to 2013.

    Don't forget to click the little star on the left of this post if you feel I helped!

  9. #9
    Registered User
    Join Date
    11-07-2012
    Location
    The Hague
    MS-Off Ver
    Excel 20037
    Posts
    10

    Re: excel if/then functions with dates and colour

    This is great! Thanks.
    Now I would like to know how you did this, because I don't see any formula.
    I am still a bit confused how to do this.

    Now that we have this I would like to add another option.
    In Column L and M are also dates and I would like that they pop up with a different colour.

    I will click the little star if I totally understand how you did this

  10. #10
    Forum Contributor
    Join Date
    11-05-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    229

    Re: excel if/then functions with dates and colour

    Select cell N7, click on Conditional Formatting > Manage rules. You will be able to see the formula I used. It is a little difficult to explain it in detail here.
    If you want more colours depending on dates in L and M, you will just need to add more rules to conditional formatting.

  11. #11
    Registered User
    Join Date
    11-07-2012
    Location
    The Hague
    MS-Off Ver
    Excel 20037
    Posts
    10

    Re: excel if/then functions with dates and colour

    Quote Originally Posted by TheExcelphile View Post
    Select cell N7, click on Conditional Formatting > Manage rules. You will be able to see the formula I used. It is a little difficult to explain it in detail here.
    If you want more colours depending on dates in L and M, you will just need to add more rules to conditional formatting.
    Thanks for the great help.
    Now this is working I want to try something els as well. And I have tried it but I am failing.

    In column F we can choose between Laptop or Workstation, If laptop is in that cell I would like to have the colour Yellow instead of Green.

    Please see attached the new spreadsheet.
    Attached Files Attached Files

  12. #12
    Forum Contributor
    Join Date
    11-05-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    229

    Re: excel if/then functions with dates and colour

    Here you go...Formule 1.1.xlsx

    Don't forget the star

  13. #13
    Registered User
    Join Date
    11-07-2012
    Location
    The Hague
    MS-Off Ver
    Excel 20037
    Posts
    10

    Re: excel if/then functions with dates and colour

    Quote Originally Posted by TheExcelphile View Post
    Here you go...Attachment 192147

    Don't forget the star
    Thanks, I did the star already - and now I don't see it. would like to give you more start.

    Is it also possible to add a thin red line that shows today's date? So that you directly can see where you are.

  14. #14
    Forum Contributor
    Join Date
    11-05-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    229

    Re: excel if/then functions with dates and colour

    Just add one more rule with the formula =(N$3=TODAY())

+ 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