+ Reply to Thread
Results 1 to 9 of 9

Create conditional formatting using date-time / text

  1. #1
    Registered User
    Join Date
    10-13-2021
    Location
    Europe
    MS-Off Ver
    MS365 2202
    Posts
    54

    Create conditional formatting using date-time / text

    Hello everybody,

    I would like to display the cells in red whenever they don't match the proper time fixed.

    For Pre 08:00, everything that is not 08:00 should be in red.
    For before 17:00, everything that is not 17:00 should be in red.


    Conditonnal formatting screenshot.png
    Attached Files Attached Files
    Last edited by Halidat; 10-19-2021 at 06:03 AM.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,728

    Re: Create conditional formatting using date-time / text

    You could use a CF rule like this for A2:

    =RIGHT(TEXT(A2,"dd/mmm/yyyy hh:mm"),5) < RIGHT(B2,5)

    If you select all the cells in column A beforehand, then you can set the conditions in one operation. Note that you may need to use semicolons ( ; ) instead of commas ( , ) in the formula, depending on your regional settings.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    10-13-2021
    Location
    Europe
    MS-Off Ver
    MS365 2202
    Posts
    54

    Re: Create conditional formatting using date-time / text

    Thank you for your answer.

    I changed the format to ( ; ) but it still doesn't work unfortunately.Attachment 752070
    Attached Files Attached Files

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,728

    Re: Create conditional formatting using date-time / text

    It shows A2 and A6 in red for the file you have attached, and the CF rule is active, so what is the problem?

    Pete

  5. #5
    Registered User
    Join Date
    10-13-2021
    Location
    Europe
    MS-Off Ver
    MS365 2202
    Posts
    54

    Re: Create conditional formatting using date-time / text

    The format doesn't apply on my file... Conditonnal formatting screenshot 3.png
    Attached Files Attached Files

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,844

    Re: Create conditional formatting using date-time / text

    It works here in your latest workbook, so maybe you need to think about your locale, which is probably French.

    A pure guess:

    =RIGHT(TEXT(A2,"dd/mmm/aaaa hh:mm"),5) < RIGHT(B2,5)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,844

    Re: Create conditional formatting using date-time / text

    Or this:

    =RIGHT(TEXT(A2,"[$-40C]dd/mmm/yyyy hh:mm"),5) < RIGHT(B2,5)

    https://excelribbon.tips.net/T011782..._Function.html

  8. #8
    Registered User
    Join Date
    10-13-2021
    Location
    Europe
    MS-Off Ver
    MS365 2202
    Posts
    54

    Re: Create conditional formatting using date-time / text

    Thank you!! It worked by changing the regional format of Windows to English UK, much more easier that way for sharing.

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,844

    Re: Create conditional formatting using date-time / text

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of all those who offered help.

+ 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] Conditional Formatting based on TIME, regardless of Date?
    By A0124B in forum Excel General
    Replies: 4
    Last Post: 10-14-2021, 01:53 PM
  2. [SOLVED] Create conditional formatting using time / date-time
    By Halidat in forum Excel General
    Replies: 3
    Last Post: 10-13-2021, 11:12 AM
  3. Replies: 1
    Last Post: 02-04-2021, 02:46 PM
  4. [SOLVED] Conditional Formatting Time Limit / Due Date
    By Wilkinson921 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-30-2020, 08:20 AM
  5. [SOLVED] Conditional formatting based on date and time
    By Jalex5134 in forum Excel General
    Replies: 6
    Last Post: 10-26-2017, 05:55 PM
  6. [SOLVED] Conditional Formatting with Date/Time with Date/Time of another cell
    By jnepsa in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 02-20-2017, 10:48 AM
  7. Formatting Cells with Date or Text Values in a Conditional Formatting Formula
    By Phil Hageman in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-15-2014, 09:36 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