+ Reply to Thread
Results 1 to 9 of 9

Format cell colour based on time interval expressed as text

  1. #1
    Forum Contributor
    Join Date
    07-25-2019
    Location
    Dhaka, Bangladesh
    MS-Off Ver
    2016
    Posts
    200

    Question Format cell colour based on time interval expressed as text

    hello everyone

    in my excel file conditional format is not working,

    im using year month days, im looking that if the days is less than 5 days then it will shows in Red color, attached file is for your convenience.

    TIA
    Attached Files Attached Files

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

    re: Format cell colour based on time interval expressed as text

    Administrative Note:

    We would very much like to help you with your query, however the thread title does not really convey what your request is about. What do you want the CF to do?

    Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
    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.

  3. #3
    Forum Contributor
    Join Date
    07-25-2019
    Location
    Dhaka, Bangladesh
    MS-Off Ver
    2016
    Posts
    200

    Re: how to use conditional format

    in cell A1 time will be mentioned, like: 5 Years, 4 Month, 17 Days
    if the cell value is less than 5 Days, like: 3 Days only then it will be shown in Red color,

    how can i do this, TIA

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,055

    re: Format cell colour based on time interval expressed as text

    To be honest... your revised title isn't much better.

    A GOOD thread title is the sort of thing you would use as a search term on Google*. Your chosen title would produce a squillion useless hits. In future, please take a bit more time to think of a descriptive title that would be "Google-friendly". Many people search the forum answers looking for help and your very general title wouldn't help them at all. However, at least you made some sort of effort... so I have changed it to something more suitable.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,055

    Re: Format cell colour based on time interval expressed as text

    One Q, as your requirement is not clear.

    Is 4 years 2 months 2 days to be formatted as red.... or only cells with ONLY days which are less than 5 are to be formatted???

  6. #6
    Forum Contributor
    Join Date
    07-25-2019
    Location
    Dhaka, Bangladesh
    MS-Off Ver
    2016
    Posts
    200

    Re: Format cell colour based on time interval expressed as text

    ONLY DAYS, when its less than 5 Days



    Ill try to provide more appropriate title from next time. thanks

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,055

    Re: Format cell colour based on time interval expressed as text

    Use this:

    =AND(ISERROR(SEARCH(",",A1)),-LOOKUP(1,-LEFT(A1,ROW($1:$10)))<5)

    applied in the file to A1:A20.
    Attached Files Attached Files

  8. #8
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Format cell colour based on time interval expressed as text

    Please try CF formula

    =TEXT(MID(0&A1,FIND("Y",0&A1&"Y")-3,2),"0;;;\0")*365+TEXT(MID(0&A1,FIND("M",0&A1&"M")-3,2),"0;;;\0")*30+TEXT(MID(0&A1,FIND("D",0&A1&"D")-3,2),"0;;;\0")<5
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    07-25-2019
    Location
    Dhaka, Bangladesh
    MS-Off Ver
    2016
    Posts
    200

    Re: Format cell colour based on time interval expressed as text

    thanks a lot Glenn Kennedy

+ 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: 1
    Last Post: 10-04-2019, 04:30 AM
  2. [SOLVED] Changing text colour in a cell based on value or colour of another cell.
    By Jeankartel in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 08-15-2019, 07:16 PM
  3. Replies: 6
    Last Post: 10-08-2018, 07:29 AM
  4. [SOLVED] format a cell background colour based on a manual background colour of an adjacent cell
    By Nampara in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-24-2018, 04:03 PM
  5. [SOLVED] Conditional format cell colour if time between a range
    By susansmith32 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-27-2016, 10:44 AM
  6. Format cell text based on cell colour.
    By RGM0 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-14-2016, 02:43 PM
  7. [SOLVED] One cell Time interval format ??
    By Lukael in forum Excel Formulas & Functions
    Replies: 26
    Last Post: 02-12-2014, 04:21 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