» Determining Whether a Worked Shift Was Morning, Afternoon or Night
CATEGORY: Excel Date & Time Formulas |
VERSIONS: All Microsoft Excel Versions |
|
Problem: We want to use the sign-in times from column A to determine whether a person was starting a morning, an afternoon, or a night shift. For times before 12:00, the formula should return "Morning Shift". For times between 12:00 and 16:00 the formula should return "Afternoon Shift". For times after 16:00, the formula should return "Night Shift". Solution: Use the IF and TIME functions as shown in the following formula: =IF(A2 |
oldchippy wrote on January 25, 2007 06:13 EST
You may have to buy the book to find the answer, it's on page 151, see link
[url]http://www.exceltip.com/pl-f1ff_contents[/url]
or you could place your question in this forum?
daddylonglegs wrote on January 25, 2007 06:25 EST
Don't know what the tip actually says but this is a fairly basic IF formula
=IF(A2>=2/3,"Night",IF(A2>=0.5,"Afternoon","Morning"))&" Shift"
..or with LOOKUP
=LOOKUP(HOUR(A2),{0,12,16},{"Morning","Afternoon","Night"})&" Shift"
Book Store:
Recommended Books:
- How to Read A Financial Report
- Analysis of Financial Statements
- Your First Business Plan: A Simple Question and Answer Format Designed to Help You Write Your Own Plan (3rd Ed)
- The One Page Business Plan: Start With a Vision, Build a Company!
- Accounting Principles, with CD, 6th Edition
- Microsoft Excel VBA Programming for the Absolute Beginner
Related MS EXCEL TIPS:
Terms
and Conditions of use
The applications/code on this site are distributed as is and without warranties
or liability. In no event shall the owner of the copyrights, or the authors
of the applications/code be liable for any loss of profit, any problems
or any damage resulting from the use or evaluation of the applications/code.






Thanks