Solved

Have cell return a 1 or 0 based on time of day

Posted on 2014-02-19
2
154 Views
Last Modified: 2014-02-19
I need to show a 1 or a 0 in cell D1 based on the time of day the report is ran. If the report is opened between 5 am and 7am I need cell D1 to have a value of 1, if not have a value of 0
0
Comment
Question by:wilpitz
2 Comments
 
LVL 22

Accepted Solution

by:
spattewar earned 500 total points
ID: 39871530
one way to do it. put this formula in D1

=IF(AND(TIME(HOUR(NOW()),MINUTE(NOW()),YEAR(NOW()))<=TIME(7,0,0),TIME(HOUR(NOW()),MINUTE(NOW()),YEAR(NOW()))>TIME(5,0,0)),1,0)

hope this helps.
0
 

Author Closing Comment

by:wilpitz
ID: 39871580
Looks great! Thanks for the fast help!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now