Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Is it possible to make Excel assume a time happens after another time?

Hey,

We're trying to create a spreadsheet that will tell us how many people we have working each hour or half hour so we can compare that to our attendance during that time period. The other users are not terribly Excel competent so it's important that on the front end it be very simple to use.

Right now what I'm trying is a page where one puts in the employee and their in and out times. Then beyond that I have a table of times with a conditional that is supposed to determine if the hour in question falls between the in and out times of the employee. It puts a 1 if the employee was working then or a 0 if they were not. Crude diagram below:

Employee | Position | IN | OUT | 16:00 | 17:00 | 18:00 |
John Usher 17:00 19:00 0 1 1

My formula in E2-G2 etc. is =IF(E$1=MEDIAN(E1,$C2:$D2),1,0)

It seems to be working, but there's a serious limitation. We're a movie theatre, so most of our shifts go past midnight. If I put 2:00 in the out time (meaning 2AM the next day), it assumes that it's the same day as the in time when it's technically the next day.

Is there a more elegant way to accomplish what we're doing, or does anyone know a fix for the past midnight problem?

Thanks,
Stevens.judo
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 16
Default Is it possible to make Excel assume a time happens after another time?

To handle these times it's easiest if you remember that Excel stores times as fractions of a day, so that 6am is stored as 0.25. However, 1.25 also represents 6am but on the next day, though if you format it as a time it'll still display as 6am (or 6:00 or whatever). If you type a few times in successive cells across as in your worksheet: 16:00, 17:00, etc. and then drag to fill to the right till you get past midnight, the values will look like 0:00, 1:00, 2:00, etc., but if you temorarily change the format from Date to General, you'll see that the times from midnight on are actually 1, 1.04167, 1.08333, etc. - that is, they're times on the next day. Which is exactly what you want in your situation, since subtracting 10:00 from 2:00 will give you a positive value. So I recommend you set up the times across the top of your worksheet like that.

But there's still the problem where your IN and OUT times are entered as, say, 10:00 and 2:00. I suggest that to handle this you modify your formula by incorporating a test of whether the OUT time is (or appears to be) less than the IN time. When it is, you just add 1 to the OUT time before doing the MEDIAN calculation. So your formula =IF(E$1=MEDIAN(E1,$C2:$D2),1,0) would become =IF(E$1=MEDIAN(E1, $C2,IF($D2<$C2, 1+$D2,$D2)),1,0). If you fill this across to the right, it should now work OK.

Hope that gives you the general idea.

Regards

Howard

On Sunday, 8 June 2014 11:40:00 UTC+10, wrote:
Hey,



We're trying to create a spreadsheet that will tell us how many people we have working each hour or half hour so we can compare that to our attendance during that time period. The other users are not terribly Excel competent so it's important that on the front end it be very simple to use.



Right now what I'm trying is a page where one puts in the employee and their in and out times. Then beyond that I have a table of times with a conditional that is supposed to determine if the hour in question falls between the in and out times of the employee. It puts a 1 if the employee was working then or a 0 if they were not. Crude diagram below:



Employee | Position | IN | OUT | 16:00 | 17:00 | 18:00 |

John Usher 17:00 19:00 0 1 1



My formula in E2-G2 etc. is =IF(E$1=MEDIAN(E1,$C2:$D2),1,0)



It seems to be working, but there's a serious limitation. We're a movie theatre, so most of our shifts go past midnight. If I put 2:00 in the out time (meaning 2AM the next day), it assumes that it's the same day as the in time when it's technically the next day.



Is there a more elegant way to accomplish what we're doing, or does anyone know a fix for the past midnight problem?



Thanks,

Stevens.judo

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I make an Excel time series chart? MA Charts and Charting in Excel 1 January 29th 08 08:00 AM
How can I make Excel recognize a time period Michel Excel Discussion (Misc queries) 3 June 19th 07 05:03 PM
Can I assume everyone has Scripting Run Time (scrrun.dll) on C:\WI Tetsuya Oguma Excel Discussion (Misc queries) 1 March 10th 06 08:36 AM
How can I make excel open every time at 200%? Jim Excel Discussion (Misc queries) 2 August 1st 05 10:54 PM
How do I make a time Stamp in excel? Ben Excel Discussion (Misc queries) 4 April 22nd 05 08:37 PM


All times are GMT +1. The time now is 06:40 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"