Forum Discussion

Nefe1930's avatar
Nefe1930
Copper Contributor
Feb 23, 2024

If statement with time.

I'm trying to have a cell that will add text based on what time it is currently. The Nested statement that I have does not put in the text.

 

I have A cell set to Now()

I have Cell B with the value of 7am, Cell C has the value of 8am.

The If statement would be: If Now() is less than 7 text is new cell will say "Low". Then if Now() is between 7 and 8 text will say "Med". Then if Now() is more than 8 text will say "High". 

This is what I have:

=IF(B1<A1,"LOW",IF(AND(B1>A1,C1<A1),"Med",IF(C1>A1,"High","")))

 

  • Nefe1930 

    As variant

    =IF( MEDIAN($B$1:$C$1, NOW() ) = $B$1,  "Low",
     IF( MEDIAN($B$1:$C$1, NOW() ) = NOW(), "Med",
     IF( MEDIAN($B$1:$C$1, NOW() ) = $C$1,  "High"
    )))
    • Nefe1930's avatar
      Nefe1930
      Copper Contributor

      SergeiBaklan 

      ok here is what is going on. The current time is 2:19pm
      The if statement is =IF( MEDIAN($D$75:$E$75, NOW() ) =$D$75, "Low",IF( MEDIAN($D$75:$E$75, NOW() ) = NOW(), "Med",IF( MEDIAN($D$75:E$75, NOW() ) = $E$75, "High")))

       

      This is what I'm getting

       

       

Resources