# If statement with time.

Copper Contributor

# 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","")))

4 Replies

# Re: If statement with time.

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"
)))``````

# Re: If statement with time.

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

# Re: If statement with time.

Try

=LET(t, MOD(NOW(),1), IF(t<D75, "Low", IF(t>E75, "High", "Med")))

# Re: If statement with time.

That worked!! thanks