+ Reply to Thread
Results 1 to 11 of 11

Conditional formatting to change colour of Rows

  1. #1
    Forum Contributor bengaluru's Avatar
    Join Date
    06-10-2005
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    150

    Conditional formatting to change colour of Rows

    I want to use conditional formatting to change the colour of the entire row when the date on A1 is any date in September (01/09/09 to 30/09/09).

    Can somebody provide me the formula for this?

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Conditional formatting to change colour of Rows

    Which row?
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Contributor
    Join Date
    08-11-2009
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    149

    Re: Conditional formatting to change colour of Rows

    The "Formula Is" option for conditional formatting just needs something that resolves to true or false; think of the first part of an IF statement.

    Here's one possible solution: =AND($A$1>VALUE("09/01/2009"),$A$1<VALUE("09/30/2009"))

    Note that you have to make A1 into an absolute reference: $A$1

    You could also put your two dates into two other cells and use absolute references in your conditional formatting to use them. This would prevent having to do "low-level" edits to your spreadsheet if you need it in the future.

  4. #4
    Forum Contributor bengaluru's Avatar
    Join Date
    06-10-2005
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    150

    Re: Conditional formatting to change colour of Rows

    Quote Originally Posted by royUK View Post
    Which row?
    Could be any row. The condition is that the first cell (the date cell) is a date in August then that entire row should change to a particular colour.

  5. #5
    Forum Contributor bengaluru's Avatar
    Join Date
    06-10-2005
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    150

    Re: Conditional formatting to change colour of Rows

    Thanks masteff.

    But it does not seem to work.

  6. #6
    Forum Contributor
    Join Date
    08-11-2009
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    149

    Re: Conditional formatting to change colour of Rows

    Opps... should have been <= and >=. That's what I get for not testing the end points.

    =AND($A$1>VALUE("09/01/2009"),$A$1<VALUE("09/30/2009"))

  7. #7
    Forum Contributor bengaluru's Avatar
    Join Date
    06-10-2005
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    150

    Re: Conditional formatting to change colour of Rows

    Quote Originally Posted by masteff View Post
    Opps... should have been <= and >=. That's what I get for not testing the end points.

    =AND($A$1>VALUE("09/01/2009"),$A$1<VALUE("09/30/2009"))
    Sorry. Can you post the actual code to be used, because you have posted the same code that did not work.

    Thanks for your help. Much appreciated.

  8. #8
    Forum Contributor
    Join Date
    08-11-2009
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    149

    Re: Conditional formatting to change colour of Rows

    Sorry, pasted the wrong bit. Should be: =AND($A$1>=VALUE("09/01/2009"),$A$1<=VALUE("09/30/2009"))
    • Highlight the rows or range of cells that you want to apply the conditional formatting to
    • On the menu, go to Format, Conditional Formatting
    • In Condition 1, change "Cell Value Is" to "Formula Is"
    • Copy and paste the formula into the box to the right of that
    • Click the "Format..." button
    • Click the patterns tab and pick a color of your choice
    • Ok, Ok

  9. #9
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Conditional formatting to change colour of Rows

    Other options if you really are only ever checking for a given month:

    =($A1-DAY($A1)+1)=DATE(2009,1,1)

    or

    =TEXT($A1,"MMYY")="0909"

  10. #10
    Forum Contributor bengaluru's Avatar
    Join Date
    06-10-2005
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    150

    Thumbs up Re: Conditional formatting to change colour of Rows

    Quote Originally Posted by masteff View Post
    Sorry, pasted the wrong bit. Should be: =AND($A$1>=VALUE("09/01/2009"),$A$1<=VALUE("09/30/2009"))
    • Highlight the rows or range of cells that you want to apply the conditional formatting to
    • On the menu, go to Format, Conditional Formatting
    • In Condition 1, change "Cell Value Is" to "Formula Is"
    • Copy and paste the formula into the box to the right of that
    • Click the "Format..." button
    • Click the patterns tab and pick a color of your choice
    • Ok, Ok
    Excellent masteff. It worked. Thanks for your time and efforts.

    DonkeyOte, thank you as well for the solution. Take care guys.

  11. #11
    Forum Contributor
    Join Date
    08-11-2009
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    149

    Re: Conditional formatting to change colour of Rows

    Quote Originally Posted by DonkeyOte View Post
    =TEXT($A1,"MMYY")="0909"
    Ah ha! That's the elegant solution!

+ 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