+ Reply to Thread
Results 1 to 7 of 7

Help with times

  1. #1
    Registered User
    Join Date
    09-28-2018
    Location
    El Salvador
    MS-Off Ver
    365
    Posts
    21

    Post Help with times

    Hello Guys, currently I am working on an excel sheet that my boss has asked me to do. The excel table has cells in time format; for example, 00:00:00 for 12 am, and 00:05:00 for 12:05 am. My boss would like the table to highlight the cell that contains 00:00:00 if the current time is between 12:00:00 a.m. and 12:04:59 a.m. And highlight 00:05:00 if the cell is between 12:05:00 a.m. and 12:09:59 a.m.

    I understand that somehow this is doable with custom formatting (correct me if I'm mistaken please) However, I have not found the way to make this work. Can you please help me on this? I only know about excel when it comes to finance.

    Thanks in advance.
    Last edited by kvallecillo; 09-28-2018 at 10:34 AM.

  2. #2
    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,933

    Re: Help with times

    Hi, welcome to the forum

    1. Are you sure those are real times and not text looking like real times? (they look like real times as you entered them here, but may not be in the real WB) Test with =isnumber(cell-ref) FALSE indicates text and we will need to convert them.

    2. Actually, I think you need Conditional Formatting, not Custom Formatting.

    3. What you need to understand about dates and times in excel is…

    a date is just a number representing the number of days passed since 1/1/900...and then formatted in a way that we recognize as a date. So, for instance, today (Fri 28 Sep 2018) is actually 43371

    Time is actually a decimal part of 1 (day), so 06:00 AM is 0.25, 12 noon is 0.5 and 18:00 (or 6 PM) is 0.75

    So you would need to test for would be something like...
    =and(A1=0,MOD(NOW(),1)>=0,MOD(NOW(),1)<=0.003460648)

    Play around with that and see how you make out?
    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

  3. #3
    Registered User
    Join Date
    09-28-2018
    Location
    El Salvador
    MS-Off Ver
    365
    Posts
    21

    Re: Help with times

    Thanks for the response.

    So if I have 5 minutes, that would be equal to 300 seconds. Am I correct? So I have to apply the rule to every cell so the amount of seconds is calculated and the highlight is applied to the cells based on the NOW() function?

  4. #4
    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,933

    Re: Help with times

    Excel sees time as a decimal of 1 (day), it then converts it to something we recognize as a time. So really, minutes and seconds dont really come into it at all, unless you want use 5/60/24 to give you 5 minutes as a decimal.

    And yes, you would need to apply that to all cells you want to highlight.

  5. #5
    Registered User
    Join Date
    09-28-2018
    Location
    El Salvador
    MS-Off Ver
    365
    Posts
    21

    Re: Help with times

    I tried it in a couple of cells, and it works! Thank you for the help, you are amazing!

  6. #6
    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,933

    Re: Help with times

    Happy to help

    Thanks for the kind words and the feedback

  7. #7
    Registered User
    Join Date
    09-28-2018
    Location
    El Salvador
    MS-Off Ver
    365
    Posts
    21

    Arrow Re: Help with times

    Is it also possible to highlight them according to time even though they contain text?

+ 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. [SOLVED] Averaging the earliest start times and latest end times for multiple days
    By kbiro in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-26-2016, 02:15 PM
  2. Replies: 21
    Last Post: 05-11-2015, 03:53 PM
  3. If a search term can be found 1 time, 2 times 3 times 4 times 5 times
    By excelcandy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-10-2013, 09:57 PM
  4. [SOLVED] calculate turn around times range of times for weekday and weekend
    By xrayexceller in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 07-28-2013, 02:22 PM
  5. Macro Loop – Find Specific Times, Extract Date, Average Values of Times
    By ExcelQuestFL in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 02-25-2010, 02:50 PM
  6. Macro to help sort date - times and average similar times.
    By ferretydeath in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-26-2008, 05:44 PM
  7. capture:How are relay leg times or driving times entered and totaled?
    By Bob Phillips in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-06-2005, 04:05 AM

Tags for this Thread

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