+ Reply to Thread
Results 1 to 24 of 24

Cell color changing based on Time passed

  1. #1
    Registered User
    Join Date
    05-31-2012
    Location
    Manchester
    MS-Off Ver
    Excel 2007
    Posts
    11

    Cell color changing based on Time passed

    Hi,

    I am developing a new Unit at work and I need to be able to highlight how long a call has been with us.

    Basically, a call is made by a member of the public and we then arrange for someone to visit. Due to other commitments we may not always be able to keep the original appointment.

    I therefore want a cell within an excel spreadsheet to change colour as time goes on. For example for a cell to be green for 2 hours, then amber for 2 hours and then red for 2 hours. The principle being that the visit needs to become a priority if the cell goes red, or we need to call the person back.

    Any ideas how I achieve this?

    Thanks

    Christine
    Last edited by monaghan4523; 05-31-2012 at 04:22 PM.

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: How do I....

    Hi Christine,
    Welcome to the forum. Please take a moment to retitle your post as per the forum rules
    http://www.excelforum.com/forum-rule...rum-rules.html
    This helps the moderators and anyone in the future searching for specific topics.

    I'd suggest something like "Cell color changing based on Time passed" Then we will respond to your post.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Cell color changing based on Time passed

    Thanks

    It's hard to be specific without a sample workbook (upload by going advanced> manage attachments).
    However, what you want is called conditional Formatting, it's on your home tab of your ribbon.
    Let's say your times are in column A beginning with A2
    Select A2:Awhatever (as far down as you think it will go)
    Conditional Formatting> New Rule > Use Formula

    = Hour(MOD(NOW(),1)-A2)>=4 format as Red
    Then repeat for
    = Hour(MOD(NOW(),1)-A2)<4 format as amber
    = Hour(MOD(NOW(),1)-A2)<2 format as green
    Go into Conditional Formatting > Manage Rules and check that all have "Stop if True" checked.
    See attachment
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    05-31-2012
    Location
    Manchester
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Cell color changing based on Time passed

    Thanks, I will try this when I get into work tomorrow. If it doesnt work I will upload the spreadsheet so you can see what Im trying to achieve.

    thanks again
    christine

  5. #5
    Registered User
    Join Date
    05-31-2012
    Location
    Manchester
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Cell color changing based on Time passed

    Hi,

    I am struggling to make this work. I have attached the spreasheet that we are trying to work with.

    When data is entered into the column that says FWIN (cell b16 down) I need that cell to turn green for the first 2 hours, then amber for the next 2 and then red for the 2 hours after that.

    The data that is entered into the FWIN column is always a number.

    Your help is extremely appreciated. Christine
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    02-07-2012
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    172

    Re: Cell color changing based on Time passed

    i was thinking you could maybe do a workaround.
    1. set up a live timer in minutes per row (in cell a4 for example) that can be started by a command button
    2. once that is clicked, use conditional formatting such that when x<a4=120 its green and so forth

    Not completely sure how this concept would be implemented but seeing as im only a novice, I'll let a pro answer

  7. #7
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Cell color changing based on Time passed

    Okay, had to modify it a little bit because your cells are formatted as text. You didn't upload a copy with how your conditional formatting was entered so I can't see what you were doing wrong. How are people entering time?
    3:30, 3:30 PM, 15:30, something else? That may cause problems if people are entering it incorrectly. For example, Excel will see 4:30 or 4:30 AM as a time but will not recognize 4:30AM. Also an entry of 4:30 will be read as 4:30 AM. I suggest you switch to time formatted and use data validation to make sure they are entering it as a number.

    In any case, the third conditional formatting rule is now
    = AND(LEN(B16)>1,Hour(MOD(NOW(),1)-B16)>=4 so that blank cells don't turn red.
    Attached is an example.
    Attached Files Attached Files
    Last edited by ChemistB; 06-01-2012 at 09:08 AM.

  8. #8
    Registered User
    Join Date
    05-31-2012
    Location
    Manchester
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Cell color changing based on Time passed

    Hi - Thanks your a star!

    I cant look at it at home as I have a mac and don't have Excel ;( so I will have to wait till I go to work next wed.

    The FWIN column is usually a number starting from 1 and going into the 1000's depending on the number of calls we get - is it that cell that will change colour? or do the guys have to enter a time for it to work? I would prefer the FWIN cell to change colour but if I need to add another column and get the guys to input the time then thats also fine?

    Thanks again - am sooo happy this will hopefully increase customer satisfaction no end !!!

    Christine

  9. #9
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Cell color changing based on Time passed

    Yes, I was assuming that you were entering a time in the FWIN column. Even if they enter a time in a different column, you can change the color of FWIN.

    It is possible to do this without actually entering the time but that will require a Visual basic solution which means everyone must have macros enabled when they are working with the spreadsheet. Do you want them to enter a time? or do you want to try Visual Basic?
    Last edited by ChemistB; 06-01-2012 at 04:26 PM.

  10. #10
    Registered User
    Join Date
    05-31-2012
    Location
    Manchester
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Cell color changing based on Time passed

    Hi, I have no idea what visual basic is! enabling macros is no problem but my experience of macros has never been a good one - find the spreadsheet is less stable and often corrupts / crashes, and with this spreadsheet it must be stable and allow multiple users to update it at the same time.

    what would you recommend?

    christine

  11. #11
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Cell color changing based on Time passed

    Here's an updated workbook with some VBA (event driven) which automatically fills in the date and time (I added a column) when someone puts in the FWIN number. Will this work for you? The code is on the worksheet module (right click on the sheet1 tab, view code).
    Please Login or Register  to view this content.
    I modified the conditional formatting statements to look at column D instead of B.
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    05-31-2012
    Location
    Manchester
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Cell color changing based on Time passed

    This will definately work - if the sheet will automatically add the date and time then this will be great. I have opened the attachment but when I put in a number in the FWIN column the cell turns to red and the date and time column is not filled in automatically.

    Is this right.

    Sorry to be a pain - I am usually very good at Excel but this is completely out of my knowledge area.

    Thanks Christine

  13. #13
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Cell color changing based on Time passed

    Hmm, I just rechecked it. Try again. Make sure you're opening Tasking Template2 from post 11 and that "content" is enabled.

  14. #14
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Cell color changing based on Time passed

    Correction. Once you've downloaded template2, I have the Conditional formatting rules in the wrong order. Go to Conditional Formating > manage rules and move the Green to before the yellow (there's a blue arrow at the top that lets you move things around). Let me know if there are issues.

  15. #15
    Registered User
    Join Date
    05-31-2012
    Location
    Manchester
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Cell color changing based on Time passed

    OMG - this is fantastic. Thankyou soooo much.


  16. #16
    Registered User
    Join Date
    05-21-2013
    Location
    Belgrade
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Cell color changing based on Time passed

    Hi Guys,

    Can you help me with my problem.

    I need my cells to change color as time passes. I need it because i am keeping track of phone calls and i need people to call by certain time. So, if someone is late I need his cell to go red :-)

    Sorry for my bad english.

    All the best,

    Milos

  17. #17
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Cell color changing based on Time passed

    shomibg,

    Unfortunately you need to post your question in a new thread, it's against the forum rules to post a question in the thread of another user. If you create your own thread, any advice will be tailored to your situation so you should include a description of what you've done and are trying to do. Also, if you feel that this thread is particularly relevant to what you are trying to do, you can surely include a link to it in your new thread.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  18. #18
    Registered User
    Join Date
    04-17-2016
    Location
    Kasane, Botswana
    MS-Off Ver
    2007
    Posts
    3

    Re: Cell color changing based on Time passed

    Hello. I am hoping for similar help please. I work in Reservations for a safari lodge.

    I have all the monthly bookings entered into a spreadsheet. Currently we allow 2 weeks for a provisional booking to stay in our system and then we need a deposit. So I would like the cell color to change from Green, Amber & Red to specify actions such as: 'Green - New Entry. Red 2 weeks are up & need to contact them for payment.

    Please can someone help me with this request?
    Thank you,
    Terry

  19. #19
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Cell color changing based on Time passed

    Yes, just start a new thread titled appropriately (something about conditional formatting dates). Ideally, attach an example spreadsheet so we can see how things are laid out. (Go Advanced>Manage Attachments)

  20. #20
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Cell color changing based on Time passed

    Misplaced post
    Last edited by ChemistB; 04-18-2016 at 11:46 AM.

  21. #21
    Registered User
    Join Date
    04-17-2016
    Location
    Kasane, Botswana
    MS-Off Ver
    2007
    Posts
    3

    Re: Cell color changing based on Time passed

    Thanks, please advise how to start a new thread?

  22. #22
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Cell color changing based on Time passed

    Click FORUM at the top, select a forum (maybe General), then click Post New Thread
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  23. #23
    Registered User
    Join Date
    10-21-2018
    Location
    Australia
    MS-Off Ver
    2007
    Posts
    2

    Re: Cell color changing based on Time passed

    G'Day spursrule68, Just a quick reply to let you know that I thought your solution very interesting, so I gave it a go and it works great! I did change the formula slightly to suit my needs, but your input pointed me in the right direction... "THANK YOU" I have created a timer that colours a cell green when a set time has passed, it also re-starts the next day by blanking those cells after 12am, as that time is less than the first set time of 8am... Would Like to attach the program, but I am also a novice and I don't see how to...? Again Thanks! =From a user of Excel less than one month.

  24. #24
    Registered User
    Join Date
    03-10-2019
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    10

    Re: Cell color changing based on Time passed

    Moving this to a new thread, as I just read the Admin message in the previous posts.

    Regret the repeated post.

    Regards
    JT
    Last edited by JediTrader; 04-24-2019 at 12:22 PM.

+ 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