Solved

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

Posted on 2014-02-19
2
156 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

809 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