+ Reply to Thread
Results 1 to 8 of 8

formatting cells with quarters based on date ranges

  1. #1
    Registered User
    Join Date
    08-02-2013
    Location
    usa
    MS-Off Ver
    Excel 2011
    Posts
    8

    formatting cells with quarters based on date ranges

    EXAMPLE FILE:
    example.xlsx

    I have a file with:
    - 2 columns: Column 1 = start date, Column 2 = end date
    - one column per quarter (Column3 = Q3 2013, Column 4= Q4 2013, etc)

    I need to color cells in quarter columns grey if the quarter in a particular column falls out of the date range in Column 1 and Column 2.
    For example: Col1=8/1/13, Col2=9/1/13
    since the date range is in Q3, cell in Q3 column will stay white, while Q4 column will be colored grey since Q4 is outside of the specified date range.

    The date range could span multiple quarters.

    Please see attached example.

    Any help would be greatly appreciated!

  2. #2
    Forum Contributor
    Join Date
    03-06-2013
    Location
    Salt Lake City, Utah
    MS-Off Ver
    2007, 2010
    Posts
    127

    Re: formatting cells with quarters based on date ranges

    You need to use conditional formatting.

    1. HOME > STYLES > CONDITIONAL FORMATTING > NEW RULE
    2. Select the "Use a formula to determine which cells to format"
    3. This the formula I used "=AND($Z17>$O$2,$Z17<$P$2)"

    I created a date because you didn't give one and I used the color green so you could see what I did. To look at the formatting, go to "Conditional Formatting" and click on "Manage Rules". It will show my work. You can do this for the other cells where you need the formatting.

    example.xlsx

    If you can provide the dates that will be compared to the date ranges you specified then I can help, otherwise you will have to input yourself.
    BrownBoy

    If happy, mark "SOVLED" & add to "REP"

  3. #3
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: formatting cells with quarters based on date ranges

    Pl see the attached file with conditional formatting.
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    03-06-2013
    Location
    Salt Lake City, Utah
    MS-Off Ver
    2007, 2010
    Posts
    127

    Re: formatting cells with quarters based on date ranges

    It was late when I sent my reply and I've dramatically improved on my original post. A quick question I have for you is what type of reporting period does your company use? A normal calendar year or fiscal year? I say this because October is in Q4 in a normal calendar year and therefore should be gray in Q3 2013 (I'm assuming). Here is my file with some notes. The original data is in the "example" sheet and "Sheet1" is my work.

    example.xlsx
    Last edited by BrownBoy; 08-03-2013 at 11:30 AM.

  5. #5
    Registered User
    Join Date
    08-02-2013
    Location
    usa
    MS-Off Ver
    Excel 2011
    Posts
    8

    Re: formatting cells with quarters based on date ranges

    Thanks a lot, BrownBoy.

    It works great (Oct in Q4 is fine). Could you suggest how to convert the words 'grey' and 'white' into actual colors for the cells? Is there anyway to convert the formula you used for conditional formatting or any other way to color cells?

  6. #6
    Registered User
    Join Date
    08-02-2013
    Location
    usa
    MS-Off Ver
    Excel 2011
    Posts
    8

    Re: formatting cells with quarters based on date ranges

    Thanks a lot, kvsrinivasamurthy. Unfortunately, when I download a file I don't seem to get any macros. I am on macbook pro.

  7. #7
    Forum Contributor
    Join Date
    03-06-2013
    Location
    Salt Lake City, Utah
    MS-Off Ver
    2007, 2010
    Posts
    127

    Re: formatting cells with quarters based on date ranges

    I already added the conditional formatting. The formulas that gave "White" or "Grey" was showing you what I did. Follow these steps to see the formatting:

    1. Click in cell "Z2"
    2. on the "Home" tab in the "Styles" section click "Conditional Formatting"
    3. Click "Manage Rules"
    4. Double click on one of the rules to show the formula.

  8. #8
    Registered User
    Join Date
    08-02-2013
    Location
    usa
    MS-Off Ver
    Excel 2011
    Posts
    8

    Re: formatting cells with quarters based on date ranges

    example-span.xlsx

    Thanks again, BrownBoy!

    I tested your file and it works great except when a date range spans multiple month. It seems to work by only coloring one cell. (please see attached, red highlight). Do you have any suggestions what to do in this case?

+ 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. VBA - If a range of cells do not contain specific text based on date ranges, then error.
    By Carrie_Smattick in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-19-2013, 07:47 PM
  2. How to mark cells based on date in other cell using conditional formatting
    By mharsvik in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-01-2012, 12:33 PM
  3. [SOLVED] Forumla/Formatting Cells Based on Date/Deadline Approaching
    By -Mat- in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-02-2012, 08:29 AM
  4. Formatting cells based on another cell date range
    By howie8790 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-26-2012, 01:53 PM
  5. Conditional Formatting Cells to reference Date Ranges
    By Vic4306623 in forum Excel General
    Replies: 1
    Last Post: 12-03-2011, 07:13 AM

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