Solved

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

Posted on 2014-02-19
2
153 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
Comment Utility
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
Comment Utility
Looks great! Thanks for the fast help!
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Dealing with unintended Excel Active-X resizing quirks (VBA code simulates "self correction") David Miller (dlmille) Intro Not everyone is a fan of Active-X controls in spreadsheets (as opposed to the UserForm approach, the older Form controls …
Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
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…

743 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

19 Experts available now in Live!

Get 1:1 Help Now