Forum Discussion

Wdstk61's avatar
Wdstk61
Copper Contributor
Apr 09, 2023
Solved

Logic Function

Can I use the logic function with time, if time > 11:59 then ...?  If so, how?

  • Wdstk61 

    If you mean the logical function IF() and the comparison operator > then this could be:

    =IF(A3>TIME(11,59,0),100,-100)

    A3 contains a time value. 

5 Replies

  • Detlef_Lewin's avatar
    Detlef_Lewin
    Silver Contributor

    Wdstk61 

    If you mean the logical function IF() and the comparison operator > then this could be:

    =IF(A3>TIME(11,59,0),100,-100)

    A3 contains a time value. 

    • Wdstk61's avatar
      Wdstk61
      Copper Contributor
      I'm still having a problem. I want to check the time in a cell to see if it is morning or evening (assign 0 before 12:00 noon or assign 1 12:00 noon or after). I tried =IF(A3<"12:00",0 ,1), but I get 1 regardless of the time in A3, or if I replace < with > I get 0 regardless of the time. A3 is formatted as hour:minute AM/PM.

Resources