Solved

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

Posted on 2014-02-19
2
157 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Suggested Solutions

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
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.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…

726 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