Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
413 views
in Technique[技术] by (71.8m points)

excel - Conditional formatting: Accounting for day rollover

I'm trying to make a spreadsheet that shows me which machines are available to me in real-time. The only issue is I do not know how to account for the day rollover. I want the "status" color to be green when the current time is within the time range "start time" and "est. end time" for that given row.

The issue occurs when the start time is in the previous day (i.e. 22:45) and the current time is in the next day (i.e. 01:00). Fig. 1 shows the template working while Fig. 2 shows how the time messes with the "AND" formula. The "AND" function seems to fail me because the function does not account for the rollover in the day. Any help on this will be appreciated!

P.S. I want it set up to where I just need to put the military time in the "start time" column and not have to put the date.

Below are my current conditions for the cells in the "status" column:

Red =NOT(ISBLANK($I2))

Orange =AND($A$1>$F2,$A$1<$G2)

Green =OR($A$1<$F2,$A$1>$G2,$F2=" ",$F2=0)

Working Template enter image description here

Overlapping Day enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...