+ Reply to Thread
Results 1 to 6 of 6

If Function with TIME and AND

  1. #1
    Registered User
    Join Date
    05-12-2016
    Location
    Newcastle, England
    MS-Off Ver
    2010
    Posts
    10

    Red face If Function with TIME and AND

    hi i wonder if anyone can help, i'm not sure if i'm trying to over complicate things but i'm struggling with a formula.

    In essence i have some job type categories where the required completion time is driven by the job type description.

    I have the job type, the job load date and the job completion date.

    I've been trying to write a formula, to demonstrate i've mocked up a table below:

    A B C
    1 Job Type Load Time Work Start Time
    2 2 hour Major Incident 15:44:30 17:58:20
    3 3 hour Major Incident 10:35:03 12:42:33
    4 4 hour Minor Incident 14:52:32 15:10:45


    So in theory i want to say if A2 is a 2 hour Major incident job request is the work start time in C2, more than 2 hours later than the load time in B2, if so we have not met our contractual target.

    I've played around with a few formula but i can't get it to work, currently i'm trying =IF(AND((A2="2 hour Major Incident",(c2-b2>=02:00:00,"OUT OF SLA","")) but i can't get a SUM function to work in an IF formula.

    Can anyone tell me where i'm going wrong and what i need to do please?

    Any help / suggestions hugely appreciated!

  2. #2
    Valued Forum Contributor
    Join Date
    05-08-2015
    Location
    Uvalde, TX
    MS-Off Ver
    2010
    Posts
    720

    Re: If Function with TIME and AND

    Hi,

    Give this a try:

    Please Login or Register  to view this content.
    The "0.08333" is the general value for 2 hours of time.

    "0.125" is for 3 hours.
    "0.166667" is for 4 hours.

    Hope it is helpful.

  3. #3
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: If Function with TIME and AND

    Alternatively, add a little table somewhere out of the way:

    O P
    1 2 hour Major Incident 0.083333
    2 3 hour Major Incident 0.125
    3 4 hour Minor Incident 0.166667

    The values in Col P are the SLA times (2,3,4 hours) as a fraction of a day, each was entered as a formula
    =2/24 or =3/24 etc... if measuring hours
    =2*60/1440 if measuring minutes

    Then add a formula to Col E (or whereever)

    =IF(C2-B2>VLOOKUP(A2, O1:P3, 2, FALSE), "Outside SLA", "OK")
    Last edited by cytop; 05-12-2016 at 02:08 PM.

  4. #4
    Registered User
    Join Date
    05-12-2016
    Location
    Newcastle, England
    MS-Off Ver
    2010
    Posts
    10

    Re: If Function with TIME and AND

    Thank you both very much, if i go for the formula option can i just nest all the different timeframes?

    =IF(AND(A2="2 hour Major Incident",(C2-B2)>=0.08333),"OUT OF SLA",""),IF(AND(A2="3 hour Major Incident",(C2-B2)>=0.125),"OUT OF SLA",""),=IF(AND(A2="4 hour Minor Incident",(C2-B2)>=0.166667),"OUT OF SLA","")

    i ask because I've tried but excel is telling me i'm missing a ).....

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: If Function with TIME and AND

    Quote Originally Posted by Newsome79 View Post
    =IF(AND(A2="2 hour Major Incident",(C2-B2)>=0.08333),"OUT OF SLA",""),IF(AND(A2="3 hour Major Incident",(C2-B2)>=0.125),"OUT OF SLA",""),=IF(AND(A2="4 hour Minor Incident",(C2-B2)>=0.166667),"OUT OF SLA","")
    Assuming the logic is correct...

    =IF(AND(A2="2 hour Major Incident",C2-B2>=0.08333),"OUT OF SLA",IF(AND(A2="3 hour Major Incident",C2-B2>=0.125),"OUT OF SLA",IF(AND(A2="4 hour Minor Incident",C2-B2>=0.166667),"OUT OF SLA","")))
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  6. #6
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2021
    Posts
    5,936

    Re: If Function with TIME and AND

    If A2 starts with the numbers , you can use ...

    =IF(C2-B2>=LEFT(A2,2)/24,"OUT OF SLA","")
    Last edited by Phuocam; 05-12-2016 at 08:02 PM.

+ 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] elapse time function ( time entered with no colon).
    By jackm1249 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-23-2014, 02:09 PM
  2. Replies: 1
    Last Post: 03-28-2014, 12:45 PM
  3. IF function to work out Ordinary hours, Time 1/2 and Double time!!
    By Jazzy2009 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-13-2014, 11:32 PM
  4. [SOLVED] IF function: Early/On Time/Late Time vs. set window of time
    By hclark579 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-21-2014, 05:37 PM
  5. [SOLVED] Extracted time from date/time field does not flag on =IF(TIME function.
    By Vlad717 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-09-2013, 03:29 PM
  6. Date/Time Function in Excel (Day/Month/Year & time)
    By tortuga32 in forum Excel General
    Replies: 19
    Last Post: 12-14-2011, 02:00 AM
  7. Replies: 4
    Last Post: 03-23-2010, 12:44 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