+ Reply to Thread
Results 1 to 10 of 10

Conditional Formatting colour change based on Hours/Time

  1. #1
    Registered User
    Join Date
    09-19-2013
    Location
    India
    MS-Off Ver
    Excel 2019
    Posts
    61

    Conditional Formatting colour change based on Hours/Time

    Hi,

    I am trying to use conditional formatting to change the font colour based on the time entry between certain hours.

    The entry times are in the format hh:mm:ss, I want the cell to have a different font color if it falls in particular time frames.
    Example:
    1) If the person entry time is by or before 09:00:00 should be in Green colour font
    2) If the person entry between 09:00:01 to 09:15:00 pink colour
    3) if the person entries after 09:15.01, the time font should appear in Red colour &
    4) if the person entries after 9:45:00, then background should be highlighted with red background
    Example spreadsheet is attached.

    However found that few cells are wrong colour appearing

    eg: Column E Row 3 and Column G Row 3 no colour appearing instead condition 2
    Few blank cells 4 condition colour appearing
    Column P, S, T, U, V & W wrongly 4th condition appearing instead of condition 1 and 2

    Thanks...Senthil
    Attached Files Attached Files

  2. #2
    Forum Expert kersplash's Avatar
    Join Date
    11-22-2016
    Location
    Perth
    MS-Off Ver
    Home 2016 (Windows 10)/Work 2013 Pro Plus (Windows 10)
    Posts
    2,012

    Re: Conditional Formatting colour change based on Hours/Time

    I think you have a mixture of text and numbers. The ones that aren't working correctly are actually text.

  3. #3
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,640

    Re: Conditional Formatting colour change based on Hours/Time

    Hi there,

    I haven't had time to look at this in detail, but the values in Columns P and S:W have been entered as string values rather than as numeric (time) values. Random cells in other columns also contain string values.

    Hope this helps - please let me know how you get on.

    Regards.

    Greg M

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,681

    Re: Conditional Formatting colour change based on Hours/Time

    The reason is you data is corrupt: some times have leading blanks.

  5. #5
    Registered User
    Join Date
    09-19-2013
    Location
    India
    MS-Off Ver
    Excel 2019
    Posts
    61

    Re: Conditional Formatting colour change based on Hours/Time

    Hi Greg M,

    I have tried removing the blank space, however as mentioned above
    > Column E to G Row 3 font colour not changed
    > Column P, S:W and Z wrongly 4th condition appearing instead of condition 1 and 2
    > though i have removed blank space, AA to AH few cell are taken the 4th condition

    I have attached the file for reference.

    Thanks.. Senthil
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,681

    Re: Conditional Formatting colour change based on Hours/Time

    Select each column, then Data ==>Text to columns==> Step 3 ==>General (radio button) ==> Finish
    Last edited by JohnTopley; 05-22-2018 at 07:37 AM.

  7. #7
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,640

    Re: Conditional Formatting colour change based on Hours/Time

    Hi again,

    See if the attached version of your workbook does what you need.

    All time values are entered as numeric (not string) values, and Condition No 3 has been incorporated into the Conditional Formatting settings.

    Hope this helps - please let me know how you get on.

    Regards,

    Greg M
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    09-19-2013
    Location
    India
    MS-Off Ver
    Excel 2019
    Posts
    61

    Re: Conditional Formatting colour change based on Hours/Time

    Hi Greg M,

    Thanks for your updates. It is working,
    I understand that you have added one more condition for the time 09:15.01 to 09:45:00. Can you please let me know by how to remove string value by selecting entire sheet? as data validation not allowing by selecting columns or Cells.

    Thanks.. Senthil

  9. #9
    Registered User
    Join Date
    09-19-2013
    Location
    India
    MS-Off Ver
    Excel 2019
    Posts
    61

    Re: Conditional Formatting colour change based on Hours/Time

    Hi JohnTopley

    Thanks for your updates.

    Regards, Senthil

  10. #10
    Registered User
    Join Date
    09-19-2013
    Location
    India
    MS-Off Ver
    Excel 2019
    Posts
    61

    Re: Conditional Formatting colour change based on Hours/Time

    Hi Gerge M,

    Can you please let me know by how to remove string value by selecting entire sheet? as data validation is allowing remove strings by selecting columns or Cells "not entire sheet in one go"

    Thanks.. Senthil

+ 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. Replies: 6
    Last Post: 04-11-2016, 09:48 AM
  2. Replies: 2
    Last Post: 02-22-2015, 11:52 AM
  3. [SOLVED] Change cell colour based on text being present - conditional formatting?
    By rob-the-randy-rascal in forum Excel General
    Replies: 8
    Last Post: 08-01-2013, 11:24 AM
  4. [SOLVED] Conditional Formatting to Change Cell Colour Based on Date
    By Kym2101 in forum Excel General
    Replies: 5
    Last Post: 05-01-2012, 11:41 PM
  5. Replies: 4
    Last Post: 12-21-2011, 11:32 AM
  6. Replies: 5
    Last Post: 10-03-2009, 04:31 PM
  7. conditional formatting to change colour of cell based on formula result
    By gideong in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-15-2009, 09:35 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