Quantcast
Channel: Hot Weekly Questions - Web Applications Stack Exchange
Viewing all articles
Browse latest Browse all 9782

How to use IF THAN statements on date but converting it to time

$
0
0

On B2, I'm trying to put in an IF timevalue statement on a datetimevalue statement with this formula

=IF (A2 < TIME (7,30,0), "PREM", IF (A2 >= TIME (7,30,0), "INTRA", "0"))

However it doesn't come out as I planned. It kept showing all of column B to be INTRA instead. How can I convert it so that it looks like the graph below?

+------------------+-------------+
|    TIME IN       | INTRA/PREM  |
+------------------+-------------+
| 2/5/2020 7:09:37 | PREM        |
| 2/5/2020 8:01:05 | INTRA       |
+------------------+-------------+

I don't know if I explained it correctly, but I want column B to calculate the datetimevalue of column A to either be "PREM" if the time is before 7:30AM, or "INTRA" if the time is at 7:30AM or after 7:30AM.


Viewing all articles
Browse latest Browse all 9782

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>