Solved

# Excel 2010 - Assign Text Label determined by Current Hour of Day

Posted on 2014-01-20
360 Views
Wish to assign cell text value to describe work shift based on current Hour of day.

example:

If Hour >= 0700 and Hour <= 1500
then "Days"
else if Hour >= 1500 and Hour <= 2300
then "Swing"
else if Hour >= 2300 and Hour <= 0700
then "Nights"
0
Question by:dlpotlatch
• 2
• 2

LVL 4

Expert Comment

I'm guessing your basing this off of a start time?  What exactly does the cell have in it that you are trying to base this off of?
0

Author Comment

Not based off a start time.  Just need to look at the value of Hour for the current time.  For example record entered in the sheet where the current value of Hour is between 0700 and 1500 would get the value Days in the cell.
0

LVL 4

Accepted Solution

tmx84 earned 500 total points
How is the cell getting the current hour of day?

So.. if A1 contains "current hour of day", something like this would work...

=IF(AND(A1>=700,A1<=1500),"Days",IF(AND(A1>=1500,A1<=2300),"Swing","Nights"))

it basically just figures out if it's between 700-1500 it's Days, 1500-2300 is Swing, and anything outside of those two is Nights...
0

Author Comment

That works, thanks much.
0

## Featured Post

### Suggested Solutions

This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
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 create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.