[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2014-02-19
2
Medium Priority
?
162 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 2000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
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…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

834 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