+ Reply to Thread
Results 1 to 10 of 10

Conditional formating 3 time frames

  1. #1
    Registered User
    Join Date
    05-27-2020
    Location
    Romania
    MS-Off Ver
    Office 365 ProPlus
    Posts
    58

    Conditional formating 3 time frames

    Hello everyone.

    Need a bit of help with some time frames. I have a fixed hour which i have to split in 3 status, early (with yellow),on time(with grees) and delay (with red).

    Let's say 09:00 AM is the target hour, 30 minutes before and 30 after is "On time" with green. I need between 8:30 - 09:30 to be green,below 08:30 early with yellow and above 09:30 to be delay with red.

    The formula i have right now is below, but with different time frames.

    =IFERROR(IF((AD3-AC3)>0.041666667,"early",IF(AC3<=AD3,"on time","delay")),"")

    Cell AD3 is 09:00AM and cell AC3 is completed manually.

    Thank you!
    Last edited by Havreliuc; 06-01-2020 at 03:07 AM.

  2. #2
    Registered User
    Join Date
    05-27-2020
    Location
    Romania
    MS-Off Ver
    Office 365 ProPlus
    Posts
    58

    Re: Conditional formating 3 time frames

    I did upload the worksheet, i hope this helps.

    Sorry for not translating the worksheet, only columns AC, AD and AE are of intrest.

    AC is arival hour
    AD is maximum arival hour
    AE is the status.
    Attached Files Attached Files

  3. #3
    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: Conditional formating 3 time frames

    So where do you want the CF to be applied to...and based on which time?
    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

  4. #4
    Registered User
    Join Date
    05-27-2020
    Location
    Romania
    MS-Off Ver
    Office 365 ProPlus
    Posts
    58

    Re: Conditional formating 3 time frames

    Quote Originally Posted by FDibbins View Post
    So where do you want the CF to be applied to...and based on which time?
    The CF is on cell AE based on the data in cell AD and AC. I need the status "On time" to be displayed in an interval of 1hr, for example if AD is 09:00AM and AC is 08:30AM to be "on time", and also above, AC 09:30AM and AD 09:00AM also "on time". Everything below 08:30AM to be "early" and above 09:30AM "delay"

  5. #5
    Registered User
    Join Date
    05-27-2020
    Location
    Romania
    MS-Off Ver
    Office 365 ProPlus
    Posts
    58

    Re: Conditional formating 3 time frames

    Let me try to be more specific, and simplify things. Below is the formula and i have 3 conditional formating on that.


    =IFERROR(IF((AD3-AC3)>0.041666667,"early",IF(AC3<=AD3,"on time","delay")),"")

    Conditional formating rules in cell AE3 based on the value of AC3 and AD3:
    If the cell contains "early" display with yellow
    If the cell contains "on time" display with green
    If the cell contains "delay" display with red

    In cell AD3 is a fixed Hour, 09:00AM
    In cell AC3 is variable time, lets say 08:30AM

    What i want is, if the time in cell AC3 is between 08:30AM and 09:30AM, compere it with cell AD3 09:00AM and display "on time" in cell AE3.
    If the time in cell AC3 is 08:20AM or 09:40AM display in AE3 "early" or "delay"

    Ignore the IFERROR in the formula, i have it to get rid of #errors if AC3 have no value in it.

    This is the best i can do

  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,719

    Re: Conditional formating 3 time frames

    Just to be very clear, conditional formatting is not what you want help with here - it's the formula that generates the word that the already existing CF will use - is this correct?

    This should do it:

    =IFERROR(IF(AND(AC3>=AD3-(1/48),AC3<=AD3+(1/48)),"on time",IF(AC3<AD3-(1/48),"early","delay")),"")
    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 Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,609

    Re: Conditional formating 3 time frames

    Please Login or Register  to view this content.
    Ben Van Johnson

  8. #8
    Registered User
    Join Date
    05-27-2020
    Location
    Romania
    MS-Off Ver
    Office 365 ProPlus
    Posts
    58

    Re: Conditional formating 3 time frames

    Quote Originally Posted by AliGW View Post
    Just to be very clear, conditional formatting is not what you want help with here - it's the formula that generates the word that the already existing CF will use - is this correct?

    This should do it:

    =IFERROR(IF(AND(AC3>=AD3-(1/48),AC3<=AD3+(1/48)),"on time",IF(AC3<AD3-(1/48),"early","delay")),"")

    Yes AliGW, you are absolutely right. My mistake with the explanation, i know the theory but i'm not good with the explanation.

    The formula works like a charm, thank you very much for your time and sorry for being a noob

    Take care!

  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,719

    Re: Conditional formating 3 time frames

    No problem, but you need to take care with thread titles in future, because this one was completely misleading in the event.

  10. #10
    Registered User
    Join Date
    05-27-2020
    Location
    Romania
    MS-Off Ver
    Office 365 ProPlus
    Posts
    58

    Re: Conditional formating 3 time frames

    Quote Originally Posted by AliGW View Post
    No problem, but you need to take care with thread titles in future, because this one was completely misleading in the event.
    I know, i'm new on the forum and as you can see i have problems explaining myself

    With time, i'll gain more knowledge through you and many others and i'll ask the right questions.

+ 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 3 diffrent time-frames
    By Havreliuc in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-27-2020, 04:10 AM
  2. Replies: 1
    Last Post: 02-19-2020, 11:57 AM
  3. How to count multiple time frames and multiple entires in those time frames
    By laurencubed in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-29-2016, 05:03 PM
  4. [SOLVED] Conditional Formating Time help
    By Beastwood in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 11-21-2013, 11:44 AM
  5. Time Formating for Conditional Formating
    By harryhoudini66 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 02-14-2013, 09:33 AM
  6. Conditional Formating - using time h:mm AM
    By Foxcan in forum Excel General
    Replies: 1
    Last Post: 06-23-2009, 09:30 AM
  7. Help with Conditional Formating Time
    By jonhunt in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-13-2006, 04:10 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