Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Excel IF formula between two times in day

I would like to have a formula that will tell me if the time in a cell is between a range of time by returning a Yes or No value.

I used a code for one time, but am having a hard time expanding the formula for two times.

=IF(G2="","",IF(G2<(--"12:00 PM"),"Yes","No"))

The above code works

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

=IF(H2="","",IF(H2<(--"12:00 PM"),H2<(--"3:00PM")),"Yes","No"))

Any help is appreciated

>Solution :

Use AND():

=IF(H2="","",IF(AND(H2<(--"12:00 PM"),H2>(--"3:00 PM")),"Yes","No"))
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading