I am trying to create an indicator to show if the financial markets are currently open or closed based on current time, and running into some issues. For anyone unfamiliar, market hours are 8:30am-3:00pm Central Time. I have to build in a factor for day of the week as well, but I am trying to get the time portion correct first. I tried first using an IF(AND( statement, but kept getting an incorrect result, so for now I've broken it down into two simple IF statements with the intended result being "before or after 8:30am" and "before or after 3:00pm". The 8:30 indicator seems to work, but as of writing this, it is 10:20am and the "before 3:00pm indicator" is showing that it is in fact after 3:00pm. FYI, K2 is used in the formulas as that's where my time value is located in my sheet. Apologies for not using the mini sheet feature as I'm using my work computer with heavy cybersecurity that restricts my downloads.
Here's what I have
Time | Before/After 8:30am | |
=now() (formatted as 24 hour clock with just hours and minutes - i.e., 13:30) | =IF(K2>=TIMEVALUE("08:30"),"AFTER OPEN","BEFORE OPEN") | =IF(K2<=TIMEVALUE("15:30"),"BEFORE CLOSE","AFTER CLOSE") |
Results, as of 10:20am:
Time | Before/After 8:30am | Before/After 3:00pm |
10:20 | AFTER OPEN | AFTER CLOSE |
Any help is much appreciated!