+ Reply to Thread
Results 1 to 8 of 8

Color rows by date

  1. #1
    Registered User
    Join Date
    01-20-2014
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    5

    Color rows by date

    Hi,

    I have a table which records different events that I am carrying out, which is often four or five a day. Column A has the dates in and then B is location C other information etc etc. I want to color the rows depending on the date in column A, preferably in alternating colors. So all events 20/01/14 one colour, then all 21/01/14 another and then all 22/01/14 the first colour.

    I want to be able to use a blank template that only has one row for each date but which will automatically format as I add in extra events. This is probably really really simple but I have wasted a lot of time not working it out yet,

    Thanks for the help,
    Sam

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,885

    Re: Color rows by date

    Look at this link.

    http://office.microsoft.com/en-us/ex...010251644.aspx
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    01-20-2014
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Color rows by date

    The problem with that solution is it alternates row by row. I want to be able to alternate by date. For example in January I started out with a blank template but ended up with one event on 14/01/14 but then 6 on 15/01/14 and 4 on 16/01/14. I want all 6 on 15th to be the same colour etc.

    I was hoping to be able to have a blank template of alternating rows where if I insert a new row below one date it would be the same colour as above?

  4. #4
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Color rows by date

    Take a look at this example.
    Attached Files Attached Files
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  5. #5
    Registered User
    Join Date
    01-20-2014
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Color rows by date

    That's perfect thank you. Do you mind explaining the formulas if you can. It's nice to understand what I am doing, then I may manage to replicate it!

    Thanks again,

    Sam

  6. #6
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Color rows by date

    In the order that the formulae are in Conditional Formatting:

    1. =$A1="" means that if cell A1 is blank do not format. This must be accompanied by using Fill, No Color otherwise it will have no effect.

    2. =MOD(DAY($A1),2)=1 This finds the "DAY" part of the date in A1 and the mod part divides the value of the DAY by 2. If the remainder of the division isn't 0 This determines that the day is an odd number. The formatting for odd numbered days can now be applied to the days where this condition applies.

    3. =MOD(DAY($A1),2)=0 This finds the "DAY" part of the date in A1 and the mod part divides the value by 2. If the day is an even number, it, when divided by 2 will have a remainder of 0. This means that the day is an even number and the formatting for even numbered days can be applied.


    The $ sign before the A is important because without it, the formatting will only be applied to column A and not the whole row.

    The Applied To field in the Rules Manager, determines the range of cells that the formatting applies to. Cells outside this range are not affected by the Conditional Formatting. To edit these ranges click in the field to be edited and hit F2 otherwise a mess will result and you will have to re-establish the range that you want affected by the Conditional Formatting. In this case all the ranges are identical (or should be). Note that the cell references are Absolute.

  7. #7
    Registered User
    Join Date
    01-20-2014
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Color rows by date

    Brilliant! Thank you so much.

  8. #8
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Color rows by date

    You're welcome....glad to help.

    Thank you for the feedback.

+ 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. Formulating Date cells to auto color code based on Date
    By darren.capps in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 04-23-2013, 02:08 PM
  2. Color fill a cell and then remove the color when a date is added.
    By texas tornado in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-25-2012, 02:14 AM
  3. macro: changing color of coloumn header based on rows color
    By rajaid in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-22-2009, 06:43 PM
  4. Replies: 5
    Last Post: 11-12-2008, 05:44 AM
  5. Find all rows of a color and copy those rows to a new worksheet
    By hshayh0rn in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-26-2006, 03:40 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