+ Reply to Thread
Results 1 to 7 of 7

Cell shading based on timeframe.

  1. #1
    Registered User
    Join Date
    08-15-2019
    Location
    Argentina
    MS-Off Ver
    2018
    Posts
    3

    Cell shading based on timeframe.

    Hello! I am in need of a way to color code the cells in my spreadsheet acording to some specific time intervals and I need them to change as time goes by.

    That is to say that from 14:00 to 22:00 I need cells to change color as the hours progress. Like red for everything between 14:00 and 14:59 and yellow for 15:00 and 15:59 and so on, and grey once the hour has passed so that once its 15:00 everything from the 14:00s is grey and now the 15:00 become red and the 16:00s become yellow and so on.

    IDK if i am explaining myself correctly but i believe i am punching above my excel weight.

    Test1.xlsm
    Last edited by Leith Ross; 08-15-2019 at 09:30 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    12-28-2014
    Location
    NSW, Australia
    MS-Off Ver
    MS365
    Posts
    604

    Re: Cell shading based on timeframe.

    Hi try this, it should apply formatting for 14:00 to 14:59. Add a new rule for each hour you need and set colour accordingly.

    Click on Conditional Formatting
    Then New rule
    Then "Use a formula to determine…."
    =HOUR($A1)=14
    Click Format and select preferred Cell Colour
    Click ok
    Click on Conditional formatting
    Then Manage rules
    Change drop down to "This Worksheet"
    Select and replace text in "Applies to:" box with "=$A:$S"

    Rinse and repeat for each hourly block changing hour numbers in formula and cell colours as desired.

  3. #3
    Valued Forum Contributor
    Join Date
    12-28-2014
    Location
    NSW, Australia
    MS-Off Ver
    MS365
    Posts
    604

    Re: Cell shading based on timeframe.

    Here's an example with the 14's and 15's set up.
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor
    Join Date
    12-28-2014
    Location
    NSW, Australia
    MS-Off Ver
    MS365
    Posts
    604

    Re: Cell shading based on timeframe.

    Wait... I think I might be wrong.
    Do you want a specific colour depending on the hour listed or on the hour since the current time?
    That formula sets a colour for the particular hour..so 14:00 to 14:59 will always be red.
    (BTW, on a side note, I was using column A not B for the time)
    If you want a specific colour to represent hours past, as in red for 4 hours ago, then you'd need a totally different formula.
    Something more like "=HOUR(NOW())-HOUR($A1)=4"

  5. #5
    Registered User
    Join Date
    08-15-2019
    Location
    Argentina
    MS-Off Ver
    2018
    Posts
    3

    Re: Cell shading based on timeframe.

    okey I see.
    I tried that but its fixed, those will always be red and yellow. what i need is the color to be a refence to the hour so that whatever cell has an earlier hour to 14:00 is grey and later hours have other colours.
    The catch here is that i need these colours to keep moving foward in time as the day progresses, meaning that at 15:00 everything with an earlier hour is grey and all the other colours have moved one timeslot ahead.

  6. #6
    Valued Forum Contributor
    Join Date
    12-28-2014
    Location
    NSW, Australia
    MS-Off Ver
    MS365
    Posts
    604

    Re: Cell shading based on timeframe.

    Here's an updated sheet using formulas like I suggested in my last post.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    08-15-2019
    Location
    Argentina
    MS-Off Ver
    2018
    Posts
    3

    Re: Cell shading based on timeframe.

    You are Godsend!!! This Was The Perfect Solution!!!

+ 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. Rows shading based on cell
    By Yurov in forum Excel General
    Replies: 5
    Last Post: 11-02-2016, 11:29 AM
  2. Help Please!! Cell to change colour if timeframe exceeded based on several choices
    By Fran Habbitts in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-26-2012, 05:56 AM
  3. Shading cells based on a value in another cell
    By lucky_girl in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 02-27-2009, 11:11 AM
  4. [SOLVED] Conditional Cell Shading (based on the shading of other cells)
    By Tubby in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-20-2006, 05:10 PM
  5. Shading cells in a row based on another cell
    By matpj in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-18-2006, 05:11 AM
  6. Column based cell shading
    By rbmcc in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-06-2006, 01:27 PM
  7. Clear cell based on shading
    By demon42 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-21-2005, 08:05 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