+ Reply to Thread
Results 1 to 3 of 3

Calculate Times

  1. #1
    Forum Contributor
    Join Date
    06-18-2010
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    546

    Calculate Times

    I need a formula to say if the time in cell A2 is before 6 p.m. Then the time in cell B2 should be before 1 p.m. If not highlight it red. Does that make sense?

    The formula I was using prior to calculate times was this:

    =IF(G2>M2,M2+1-G2,M2-G2)

    Where
    G2 was my Requested Time
    M2 was my Received Time

    But now I want to add the condition of if G2 is before 6 p.m. then M2 should be before 1 p.m.

    How can I accomplish this?

  2. #2
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Calculate Times

    You need to use Conditional Formatting, formula option.

    Assuming both G2 and M2 contain valid times (only - not a date/time), then you could use this formula

    =AND(G2<0.75,M2<0.5412)

    Time is a fractional value of a day.
    A day is the whole (1). One hour = 1/24 of a day = 0.041667.
    6:00 pm = 18 hours, so 18*0.41667 = .75
    1:00 pm = 13 hours, so 13* 0.41667 = 0.5416677
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  3. #3
    Forum Contributor
    Join Date
    06-18-2010
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    546

    Re: Calculate Times

    Let me clarify a little big, lets say that A1 is 03/31/2011 and A2 is before 6 pm then B1 should be 04/01/2011 and B2 should be before 1 pm.

    Would this formula work for this scenario as well?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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