#1   Report Post  
Jeff
 
Posts: n/a
Default Assumed Lunch

Please help,

I need a VB code for assumed lunch.

=(E6<D6)+E6-D6+(G6<F6)+G6-F6 is the code I am currently using to calculate
total hours worked per day.
D6 is "StartWork", E6 is "StartLunch", F6 is "EndLunch" G6 is "EndWork".

Our employees do not punch out for lunch unless if they are going to be
longer than 1/2 hour. Otherwise we just assume 1/2 hour or "no lunch" if
they write "no lunch" on their card.

To address the assumed lunch:
What I need is a VB code so that what I enter in "StartWork" (E6) is
automaticaly repeated in "StartLunch" (F6) and puts the time that is 1/2
hour later in "EndLunch".

I already have a macro to address the no lunch issue.

Thank you,
Jeff
  #2   Report Post  
Bill Kuunders
 
Posts: n/a
Default

no macro's
just an if function

assume A1 is start time entered as 08:00
B1 is end time entered as 16:30
in C1 you enter 0 if no lunch
or for example 1.5 if lunch was longer than 0.5
or you leave it empty for most cases.
enter formula in D1 =IF(C10.5,C1,IF(C1="",0.5,0))
enter formula in E1 =((A1B1)+B1-A1)*24-D1

Regards
Bill K

"Jeff" wrote in message
...
Please help,

I need a VB code for assumed lunch.

=(E6<D6)+E6-D6+(G6<F6)+G6-F6 is the code I am currently using to
calculate
total hours worked per day.
D6 is "StartWork", E6 is "StartLunch", F6 is "EndLunch" G6 is "EndWork".

Our employees do not punch out for lunch unless if they are going to be
longer than 1/2 hour. Otherwise we just assume 1/2 hour or "no lunch" if
they write "no lunch" on their card.

To address the assumed lunch:
What I need is a VB code so that what I enter in "StartWork" (E6) is
automaticaly repeated in "StartLunch" (F6) and puts the time that is 1/2
hour later in "EndLunch".

I already have a macro to address the no lunch issue.

Thank you,
Jeff



  #3   Report Post  
Jeff
 
Posts: n/a
Default

Thanks Bill,
This will work Just fine and I can turn it into a macro now that I
understand how to add and subtract time (that was the main problem.)
I am getting there.
Jeff

"Bill Kuunders" wrote:

no macro's
just an if function

assume A1 is start time entered as 08:00
B1 is end time entered as 16:30
in C1 you enter 0 if no lunch
or for example 1.5 if lunch was longer than 0.5
or you leave it empty for most cases.
enter formula in D1 =IF(C10.5,C1,IF(C1="",0.5,0))
enter formula in E1 =((A1B1)+B1-A1)*24-D1

Regards
Bill K

"Jeff" wrote in message
...
Please help,

I need a VB code for assumed lunch.

=(E6<D6)+E6-D6+(G6<F6)+G6-F6 is the code I am currently using to
calculate
total hours worked per day.
D6 is "StartWork", E6 is "StartLunch", F6 is "EndLunch" G6 is "EndWork".

Our employees do not punch out for lunch unless if they are going to be
longer than 1/2 hour. Otherwise we just assume 1/2 hour or "no lunch" if
they write "no lunch" on their card.

To address the assumed lunch:
What I need is a VB code so that what I enter in "StartWork" (E6) is
automaticaly repeated in "StartLunch" (F6) and puts the time that is 1/2
hour later in "EndLunch".

I already have a macro to address the no lunch issue.

Thank you,
Jeff




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 Excel do daily timesheet, -lunch time, & not use colon in. Jan Excel Worksheet Functions 2 March 8th 05 10:05 PM


All times are GMT +1. The time now is 06:26 PM.

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"