Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 231
Default Timecard - Calculating Time Error

I have created a time card where employees choose from a drop down box what
time the started, time they left for lunch, returned for lunch, and then left
to go home. I have the time in the following columns

C D E F G
16 Time In Lunch Out Lunch In Time Out Total Hours Worked

I have the following function in G16:
=IF(((D16-C16+(C16D16)+F16-E16+(E16F16))*24)8,"ERROR - Please check your
hours.",((D16-C16+(C16D16)+F16-E16+(E16F16))*24)).

the purpose it to not allow employees to enter more than 8 hours per day and
make them enter a time for all four cells. However we are getting errors for
such things as:
C D E F
16 8:15am 11:30am 12:30am 5:15pm

Please advise.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,441
Default Timecard - Calculating Time Error

C D E F
16 8:15am 11:30am 12:30am 5:15pm



Try

8:15am 11:30am 12:30PM 5:15pm


--
HTH,
Bernie
MS Excel MVP


"Sarah" wrote in message
...
I have created a time card where employees choose from a drop down box what
time the started, time they left for lunch, returned for lunch, and then left
to go home. I have the time in the following columns

C D E F G
16 Time In Lunch Out Lunch In Time Out Total Hours Worked

I have the following function in G16:
=IF(((D16-C16+(C16D16)+F16-E16+(E16F16))*24)8,"ERROR - Please check your
hours.",((D16-C16+(C16D16)+F16-E16+(E16F16))*24)).

the purpose it to not allow employees to enter more than 8 hours per day and
make them enter a time for all four cells. However we are getting errors for
such things as:
C D E F
16 8:15am 11:30am 12:30am 5:15pm

Please advise.



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default Timecard - Calculating Time Error

Lunch in time is 12:30 am instead of 12:30 PM

"Sarah" wrote:

I have created a time card where employees choose from a drop down box what
time the started, time they left for lunch, returned for lunch, and then left
to go home. I have the time in the following columns

C D E F G
16 Time In Lunch Out Lunch In Time Out Total Hours Worked

I have the following function in G16:
=IF(((D16-C16+(C16D16)+F16-E16+(E16F16))*24)8,"ERROR - Please check your
hours.",((D16-C16+(C16D16)+F16-E16+(E16F16))*24)).

the purpose it to not allow employees to enter more than 8 hours per day and
make them enter a time for all four cells. However we are getting errors for
such things as:
C D E F
16 8:15am 11:30am 12:30am 5:15pm

Please advise.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 231
Default Timecard - Calculating Time Error

I am sorry that is what I meant - 12:30pm

"Joel" wrote:

Lunch in time is 12:30 am instead of 12:30 PM

"Sarah" wrote:

I have created a time card where employees choose from a drop down box what
time the started, time they left for lunch, returned for lunch, and then left
to go home. I have the time in the following columns

C D E F G
16 Time In Lunch Out Lunch In Time Out Total Hours Worked

I have the following function in G16:
=IF(((D16-C16+(C16D16)+F16-E16+(E16F16))*24)8,"ERROR - Please check your
hours.",((D16-C16+(C16D16)+F16-E16+(E16F16))*24)).

the purpose it to not allow employees to enter more than 8 hours per day and
make them enter a time for all four cells. However we are getting errors for
such things as:
C D E F
16 8:15am 11:30am 12:30am 5:15pm

Please advise.

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,268
Default Timecard - Calculating Time Error

It can be shortened to

=IF(MOD(F16-C16,1)-MOD(E16-D16,1)"08:00","ERROR, Check your
hours",(MOD(F16-C16,1)-MOD(E16-D16,1))*24)

format as general

however I tested your formula and it works so the dropdown results must be
wrong

--
Regards,

Peo Sjoblom

"Sarah" wrote in message
...
I am sorry that is what I meant - 12:30pm

"Joel" wrote:

Lunch in time is 12:30 am instead of 12:30 PM

"Sarah" wrote:

I have created a time card where employees choose from a drop down box
what
time the started, time they left for lunch, returned for lunch, and
then left
to go home. I have the time in the following columns

C D E F G
16 Time In Lunch Out Lunch In Time Out Total Hours Worked

I have the following function in G16:
=IF(((D16-C16+(C16D16)+F16-E16+(E16F16))*24)8,"ERROR - Please check
your
hours.",((D16-C16+(C16D16)+F16-E16+(E16F16))*24)).

the purpose it to not allow employees to enter more than 8 hours per
day and
make them enter a time for all four cells. However we are getting
errors for
such things as:
C D E F
16 8:15am 11:30am 12:30am 5:15pm

Please advise.





  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,441
Default Timecard - Calculating Time Error

Sarah,

Another possibility is that you have formatted the cells as time, and there is a date/time in one of
the cells, but it is only showing the time. Try formatting all the cells for number / decimal, and
see if any are greater than 1.

HTH,
Bernie
MS Excel MVP


"Sarah" wrote in message
...
I am sorry that is what I meant - 12:30pm

"Joel" wrote:

Lunch in time is 12:30 am instead of 12:30 PM

"Sarah" wrote:

I have created a time card where employees choose from a drop down box what
time the started, time they left for lunch, returned for lunch, and then left
to go home. I have the time in the following columns

C D E F G
16 Time In Lunch Out Lunch In Time Out Total Hours Worked

I have the following function in G16:
=IF(((D16-C16+(C16D16)+F16-E16+(E16F16))*24)8,"ERROR - Please check your
hours.",((D16-C16+(C16D16)+F16-E16+(E16F16))*24)).

the purpose it to not allow employees to enter more than 8 hours per day and
make them enter a time for all four cells. However we are getting errors for
such things as:
C D E F
16 8:15am 11:30am 12:30am 5:15pm

Please advise.



  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 231
Default Timecard - Calculating Time Error

It won't bring up "ERROR..." any more?

"Peo Sjoblom" wrote:

It can be shortened to

=IF(MOD(F16-C16,1)-MOD(E16-D16,1)"08:00","ERROR, Check your
hours",(MOD(F16-C16,1)-MOD(E16-D16,1))*24)

format as general

however I tested your formula and it works so the dropdown results must be
wrong

--
Regards,

Peo Sjoblom

"Sarah" wrote in message
...
I am sorry that is what I meant - 12:30pm

"Joel" wrote:

Lunch in time is 12:30 am instead of 12:30 PM

"Sarah" wrote:

I have created a time card where employees choose from a drop down box
what
time the started, time they left for lunch, returned for lunch, and
then left
to go home. I have the time in the following columns

C D E F G
16 Time In Lunch Out Lunch In Time Out Total Hours Worked

I have the following function in G16:
=IF(((D16-C16+(C16D16)+F16-E16+(E16F16))*24)8,"ERROR - Please check
your
hours.",((D16-C16+(C16D16)+F16-E16+(E16F16))*24)).

the purpose it to not allow employees to enter more than 8 hours per
day and
make them enter a time for all four cells. However we are getting
errors for
such things as:
C D E F
16 8:15am 11:30am 12:30am 5:15pm

Please advise.




  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default Timecard - Calculating Time Error

Sarah: Try this. delete all space in cells and delete AM and PM. If it is
really time format removing the Am and PM will c ause excel to put them back
automatically.

=IF(AND(D16C16,E16D16,F16E16,24*((D16-C16)+(F16-E16))=8),24*((D16-C16)+(F16-E16)),"ERROR - Please check your
hours.")

"Sarah" wrote:

It won't bring up "ERROR..." any more?

"Peo Sjoblom" wrote:

It can be shortened to

=IF(MOD(F16-C16,1)-MOD(E16-D16,1)"08:00","ERROR, Check your
hours",(MOD(F16-C16,1)-MOD(E16-D16,1))*24)

format as general

however I tested your formula and it works so the dropdown results must be
wrong

--
Regards,

Peo Sjoblom

"Sarah" wrote in message
...
I am sorry that is what I meant - 12:30pm

"Joel" wrote:

Lunch in time is 12:30 am instead of 12:30 PM

"Sarah" wrote:

I have created a time card where employees choose from a drop down box
what
time the started, time they left for lunch, returned for lunch, and
then left
to go home. I have the time in the following columns

C D E F G
16 Time In Lunch Out Lunch In Time Out Total Hours Worked

I have the following function in G16:
=IF(((D16-C16+(C16D16)+F16-E16+(E16F16))*24)8,"ERROR - Please check
your
hours.",((D16-C16+(C16D16)+F16-E16+(E16F16))*24)).

the purpose it to not allow employees to enter more than 8 hours per
day and
make them enter a time for all four cells. However we are getting
errors for
such things as:
C D E F
16 8:15am 11:30am 12:30am 5:15pm

Please advise.




  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,268
Default Timecard - Calculating Time Error

The problem is not your formula, it's your data. I just showed you another
formula that will work as well. Your original formula works fine. It's your
data that is incorrect

--
Regards,

Peo Sjoblom


"Sarah" wrote in message
...
It won't bring up "ERROR..." any more?

"Peo Sjoblom" wrote:

It can be shortened to

=IF(MOD(F16-C16,1)-MOD(E16-D16,1)"08:00","ERROR, Check your
hours",(MOD(F16-C16,1)-MOD(E16-D16,1))*24)

format as general

however I tested your formula and it works so the dropdown results must
be
wrong

--
Regards,

Peo Sjoblom

"Sarah" wrote in message
...
I am sorry that is what I meant - 12:30pm

"Joel" wrote:

Lunch in time is 12:30 am instead of 12:30 PM

"Sarah" wrote:

I have created a time card where employees choose from a drop down
box
what
time the started, time they left for lunch, returned for lunch, and
then left
to go home. I have the time in the following columns

C D E F
G
16 Time In Lunch Out Lunch In Time Out Total Hours Worked

I have the following function in G16:
=IF(((D16-C16+(C16D16)+F16-E16+(E16F16))*24)8,"ERROR - Please
check
your
hours.",((D16-C16+(C16D16)+F16-E16+(E16F16))*24)).

the purpose it to not allow employees to enter more than 8 hours per
day and
make them enter a time for all four cells. However we are getting
errors for
such things as:
C D E F
16 8:15am 11:30am 12:30am 5:15pm

Please advise.






  #10   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,268
Default Timecard - Calculating Time Error

You are right, try this

=IF((MOD(F16-C16,1)-MOD(E16-D16,1))*248,"ERROR, Check your
hours",(MOD(F16-C16,1)-MOD(E16-D16,1))*24)


regardless your formula is correct


--
Regards,

Peo Sjoblom



"Sarah" wrote in message
...
It won't bring up "ERROR..." any more?

"Peo Sjoblom" wrote:

It can be shortened to

=IF(MOD(F16-C16,1)-MOD(E16-D16,1)"08:00","ERROR, Check your
hours",(MOD(F16-C16,1)-MOD(E16-D16,1))*24)

format as general

however I tested your formula and it works so the dropdown results must
be
wrong

--
Regards,

Peo Sjoblom

"Sarah" wrote in message
...
I am sorry that is what I meant - 12:30pm

"Joel" wrote:

Lunch in time is 12:30 am instead of 12:30 PM

"Sarah" wrote:

I have created a time card where employees choose from a drop down
box
what
time the started, time they left for lunch, returned for lunch, and
then left
to go home. I have the time in the following columns

C D E F
G
16 Time In Lunch Out Lunch In Time Out Total Hours Worked

I have the following function in G16:
=IF(((D16-C16+(C16D16)+F16-E16+(E16F16))*24)8,"ERROR - Please
check
your
hours.",((D16-C16+(C16D16)+F16-E16+(E16F16))*24)).

the purpose it to not allow employees to enter more than 8 hours per
day and
make them enter a time for all four cells. However we are getting
errors for
such things as:
C D E F
16 8:15am 11:30am 12:30am 5:15pm

Please advise.








  #11   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,268
Default Timecard - Calculating Time Error

That formula will do the reverse what Sarah wanted, it will return an error
if it less than 8 hours and it won't work if the start time is before
midnight and the end time is after midnight



--
Regards,

Peo Sjoblom




"Joel" wrote in message
...
Sarah: Try this. delete all space in cells and delete AM and PM. If it
is
really time format removing the Am and PM will c ause excel to put them
back
automatically.

=IF(AND(D16C16,E16D16,F16E16,24*((D16-C16)+(F16-E16))=8),24*((D16-C16)+(F16-E16)),"ERROR
- Please check your
hours.")

"Sarah" wrote:

It won't bring up "ERROR..." any more?

"Peo Sjoblom" wrote:

It can be shortened to

=IF(MOD(F16-C16,1)-MOD(E16-D16,1)"08:00","ERROR, Check your
hours",(MOD(F16-C16,1)-MOD(E16-D16,1))*24)

format as general

however I tested your formula and it works so the dropdown results must
be
wrong

--
Regards,

Peo Sjoblom

"Sarah" wrote in message
...
I am sorry that is what I meant - 12:30pm

"Joel" wrote:

Lunch in time is 12:30 am instead of 12:30 PM

"Sarah" wrote:

I have created a time card where employees choose from a drop down
box
what
time the started, time they left for lunch, returned for lunch,
and
then left
to go home. I have the time in the following columns

C D E F
G
16 Time In Lunch Out Lunch In Time Out Total Hours Worked

I have the following function in G16:
=IF(((D16-C16+(C16D16)+F16-E16+(E16F16))*24)8,"ERROR - Please
check
your
hours.",((D16-C16+(C16D16)+F16-E16+(E16F16))*24)).

the purpose it to not allow employees to enter more than 8 hours
per
day and
make them enter a time for all four cells. However we are getting
errors for
such things as:
C D E F
16 8:15am 11:30am 12:30am 5:15pm

Please advise.





  #12   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default Timecard - Calculating Time Error

My formula is correct and I tested it. Look again.

"Peo Sjoblom" wrote:

That formula will do the reverse what Sarah wanted, it will return an error
if it less than 8 hours and it won't work if the start time is before
midnight and the end time is after midnight



--
Regards,

Peo Sjoblom




"Joel" wrote in message
...
Sarah: Try this. delete all space in cells and delete AM and PM. If it
is
really time format removing the Am and PM will c ause excel to put them
back
automatically.

=IF(AND(D16C16,E16D16,F16E16,24*((D16-C16)+(F16-E16))=8),24*((D16-C16)+(F16-E16)),"ERROR
- Please check your
hours.")

"Sarah" wrote:

It won't bring up "ERROR..." any more?

"Peo Sjoblom" wrote:

It can be shortened to

=IF(MOD(F16-C16,1)-MOD(E16-D16,1)"08:00","ERROR, Check your
hours",(MOD(F16-C16,1)-MOD(E16-D16,1))*24)

format as general

however I tested your formula and it works so the dropdown results must
be
wrong

--
Regards,

Peo Sjoblom

"Sarah" wrote in message
...
I am sorry that is what I meant - 12:30pm

"Joel" wrote:

Lunch in time is 12:30 am instead of 12:30 PM

"Sarah" wrote:

I have created a time card where employees choose from a drop down
box
what
time the started, time they left for lunch, returned for lunch,
and
then left
to go home. I have the time in the following columns

C D E F
G
16 Time In Lunch Out Lunch In Time Out Total Hours Worked

I have the following function in G16:
=IF(((D16-C16+(C16D16)+F16-E16+(E16F16))*24)8,"ERROR - Please
check
your
hours.",((D16-C16+(C16D16)+F16-E16+(E16F16))*24)).

the purpose it to not allow employees to enter more than 8 hours
per
day and
make them enter a time for all four cells. However we are getting
errors for
such things as:
C D E F
16 8:15am 11:30am 12:30am 5:15pm

Please advise.






  #13   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,268
Default Timecard - Calculating Time Error

"the purpose it to not allow employees to enter more than 8 hours per day"


With the times as follows

07:30 11:30 12:30 16:31

your formula returns

8.016667


when it should return

"ERROR - Please check your hours."

now change those times to

07:30 11:30 12:30 16:00 7.5

then your formula will return

"ERROR - Please check your hours."

whereas it should return

7.5

now change the times to

18:00 22:00 23:00 04:00

with an end time after midnight and your formula will return

"ERROR - Please check your hours."

regardless whether the time is greater or less than 8 hours

so I tested it and it doesn't work with regards to the OP's requirements of
trying to prevent more than 8 hours totally, and if the start time is before
midnight and end time after midnight it doesn't work at all.


--
Regards,

Peo Sjoblom


"Joel" wrote in message
...
My formula is correct and I tested it. Look again.

"Peo Sjoblom" wrote:

That formula will do the reverse what Sarah wanted, it will return an
error
if it less than 8 hours and it won't work if the start time is before
midnight and the end time is after midnight



--
Regards,

Peo Sjoblom




"Joel" wrote in message
...
Sarah: Try this. delete all space in cells and delete AM and PM. If
it
is
really time format removing the Am and PM will c ause excel to put them
back
automatically.

=IF(AND(D16C16,E16D16,F16E16,24*((D16-C16)+(F16-E16))=8),24*((D16-C16)+(F16-E16)),"ERROR
- Please check your
hours.")

"Sarah" wrote:

It won't bring up "ERROR..." any more?

"Peo Sjoblom" wrote:

It can be shortened to

=IF(MOD(F16-C16,1)-MOD(E16-D16,1)"08:00","ERROR, Check your
hours",(MOD(F16-C16,1)-MOD(E16-D16,1))*24)

format as general

however I tested your formula and it works so the dropdown results
must
be
wrong

--
Regards,

Peo Sjoblom

"Sarah" wrote in message
...
I am sorry that is what I meant - 12:30pm

"Joel" wrote:

Lunch in time is 12:30 am instead of 12:30 PM

"Sarah" wrote:

I have created a time card where employees choose from a drop
down
box
what
time the started, time they left for lunch, returned for lunch,
and
then left
to go home. I have the time in the following columns

C D E F
G
16 Time In Lunch Out Lunch In Time Out Total Hours
Worked

I have the following function in G16:
=IF(((D16-C16+(C16D16)+F16-E16+(E16F16))*24)8,"ERROR -
Please
check
your
hours.",((D16-C16+(C16D16)+F16-E16+(E16F16))*24)).

the purpose it to not allow employees to enter more than 8
hours
per
day and
make them enter a time for all four cells. However we are
getting
errors for
such things as:
C D E F
16 8:15am 11:30am 12:30am 5:15pm

Please advise.








  #14   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 231
Default Timecard - Calculating Time Error

This dosen't show "Error..." when it is over 8 hours

"Joel" wrote:

My formula is correct and I tested it. Look again.

"Peo Sjoblom" wrote:

That formula will do the reverse what Sarah wanted, it will return an error
if it less than 8 hours and it won't work if the start time is before
midnight and the end time is after midnight



--
Regards,

Peo Sjoblom




"Joel" wrote in message
...
Sarah: Try this. delete all space in cells and delete AM and PM. If it
is
really time format removing the Am and PM will c ause excel to put them
back
automatically.

=IF(AND(D16C16,E16D16,F16E16,24*((D16-C16)+(F16-E16))=8),24*((D16-C16)+(F16-E16)),"ERROR
- Please check your
hours.")

"Sarah" wrote:

It won't bring up "ERROR..." any more?

"Peo Sjoblom" wrote:

It can be shortened to

=IF(MOD(F16-C16,1)-MOD(E16-D16,1)"08:00","ERROR, Check your
hours",(MOD(F16-C16,1)-MOD(E16-D16,1))*24)

format as general

however I tested your formula and it works so the dropdown results must
be
wrong

--
Regards,

Peo Sjoblom

"Sarah" wrote in message
...
I am sorry that is what I meant - 12:30pm

"Joel" wrote:

Lunch in time is 12:30 am instead of 12:30 PM

"Sarah" wrote:

I have created a time card where employees choose from a drop down
box
what
time the started, time they left for lunch, returned for lunch,
and
then left
to go home. I have the time in the following columns

C D E F
G
16 Time In Lunch Out Lunch In Time Out Total Hours Worked

I have the following function in G16:
=IF(((D16-C16+(C16D16)+F16-E16+(E16F16))*24)8,"ERROR - Please
check
your
hours.",((D16-C16+(C16D16)+F16-E16+(E16F16))*24)).

the purpose it to not allow employees to enter more than 8 hours
per
day and
make them enter a time for all four cells. However we are getting
errors for
such things as:
C D E F
16 8:15am 11:30am 12:30am 5:15pm

Please advise.






  #15   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,268
Default Timecard - Calculating Time Error

Sarah,

there is nothing wrong with your original formula, it is the data from the
dropdowns that is incorrect, they might be text or as Bernie suggested they
might be larger than what they look like, one day and 6 hours will display
as 06:00 if formatted as hh:mm


--
Regards,

Peo Sjoblom

"Sarah" wrote in message
...
This dosen't show "Error..." when it is over 8 hours

"Joel" wrote:

My formula is correct and I tested it. Look again.

"Peo Sjoblom" wrote:

That formula will do the reverse what Sarah wanted, it will return an
error
if it less than 8 hours and it won't work if the start time is before
midnight and the end time is after midnight



--
Regards,

Peo Sjoblom




"Joel" wrote in message
...
Sarah: Try this. delete all space in cells and delete AM and PM. If
it
is
really time format removing the Am and PM will c ause excel to put
them
back
automatically.

=IF(AND(D16C16,E16D16,F16E16,24*((D16-C16)+(F16-E16))=8),24*((D16-C16)+(F16-E16)),"ERROR
- Please check your
hours.")

"Sarah" wrote:

It won't bring up "ERROR..." any more?

"Peo Sjoblom" wrote:

It can be shortened to

=IF(MOD(F16-C16,1)-MOD(E16-D16,1)"08:00","ERROR, Check your
hours",(MOD(F16-C16,1)-MOD(E16-D16,1))*24)

format as general

however I tested your formula and it works so the dropdown results
must
be
wrong

--
Regards,

Peo Sjoblom

"Sarah" wrote in message
...
I am sorry that is what I meant - 12:30pm

"Joel" wrote:

Lunch in time is 12:30 am instead of 12:30 PM

"Sarah" wrote:

I have created a time card where employees choose from a drop
down
box
what
time the started, time they left for lunch, returned for
lunch,
and
then left
to go home. I have the time in the following columns

C D E F
G
16 Time In Lunch Out Lunch In Time Out Total Hours
Worked

I have the following function in G16:
=IF(((D16-C16+(C16D16)+F16-E16+(E16F16))*24)8,"ERROR -
Please
check
your
hours.",((D16-C16+(C16D16)+F16-E16+(E16F16))*24)).

the purpose it to not allow employees to enter more than 8
hours
per
day and
make them enter a time for all four cells. However we are
getting
errors for
such things as:
C D E F
16 8:15am 11:30am 12:30am 5:15pm

Please advise.










  #16   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default Timecard - Calculating Time Error

As I said earlier
1) Format cell for time
2) remove all spaces in data, both before and after the time.
3) Delete AM, PM, and spaces between time and AM/PM.

"Sarah" wrote:

This dosen't show "Error..." when it is over 8 hours

"Joel" wrote:

My formula is correct and I tested it. Look again.

"Peo Sjoblom" wrote:

That formula will do the reverse what Sarah wanted, it will return an error
if it less than 8 hours and it won't work if the start time is before
midnight and the end time is after midnight



--
Regards,

Peo Sjoblom




"Joel" wrote in message
...
Sarah: Try this. delete all space in cells and delete AM and PM. If it
is
really time format removing the Am and PM will c ause excel to put them
back
automatically.

=IF(AND(D16C16,E16D16,F16E16,24*((D16-C16)+(F16-E16))=8),24*((D16-C16)+(F16-E16)),"ERROR
- Please check your
hours.")

"Sarah" wrote:

It won't bring up "ERROR..." any more?

"Peo Sjoblom" wrote:

It can be shortened to

=IF(MOD(F16-C16,1)-MOD(E16-D16,1)"08:00","ERROR, Check your
hours",(MOD(F16-C16,1)-MOD(E16-D16,1))*24)

format as general

however I tested your formula and it works so the dropdown results must
be
wrong

--
Regards,

Peo Sjoblom

"Sarah" wrote in message
...
I am sorry that is what I meant - 12:30pm

"Joel" wrote:

Lunch in time is 12:30 am instead of 12:30 PM

"Sarah" wrote:

I have created a time card where employees choose from a drop down
box
what
time the started, time they left for lunch, returned for lunch,
and
then left
to go home. I have the time in the following columns

C D E F
G
16 Time In Lunch Out Lunch In Time Out Total Hours Worked

I have the following function in G16:
=IF(((D16-C16+(C16D16)+F16-E16+(E16F16))*24)8,"ERROR - Please
check
your
hours.",((D16-C16+(C16D16)+F16-E16+(E16F16))*24)).

the purpose it to not allow employees to enter more than 8 hours
per
day and
make them enter a time for all four cells. However we are getting
errors for
such things as:
C D E F
16 8:15am 11:30am 12:30am 5:15pm

Please advise.






  #17   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,268
Default Timecard - Calculating Time Error

It doesn't matter since your formula does the opposite of what she wants


--
Regards,

Peo Sjoblom



"Joel" wrote in message
...
As I said earlier
1) Format cell for time
2) remove all spaces in data, both before and after the time.
3) Delete AM, PM, and spaces between time and AM/PM.

"Sarah" wrote:

This dosen't show "Error..." when it is over 8 hours

"Joel" wrote:

My formula is correct and I tested it. Look again.

"Peo Sjoblom" wrote:

That formula will do the reverse what Sarah wanted, it will return an
error
if it less than 8 hours and it won't work if the start time is before
midnight and the end time is after midnight



--
Regards,

Peo Sjoblom




"Joel" wrote in message
...
Sarah: Try this. delete all space in cells and delete AM and PM.
If it
is
really time format removing the Am and PM will c ause excel to put
them
back
automatically.

=IF(AND(D16C16,E16D16,F16E16,24*((D16-C16)+(F16-E16))=8),24*((D16-C16)+(F16-E16)),"ERROR
- Please check your
hours.")

"Sarah" wrote:

It won't bring up "ERROR..." any more?

"Peo Sjoblom" wrote:

It can be shortened to

=IF(MOD(F16-C16,1)-MOD(E16-D16,1)"08:00","ERROR, Check your
hours",(MOD(F16-C16,1)-MOD(E16-D16,1))*24)

format as general

however I tested your formula and it works so the dropdown
results must
be
wrong

--
Regards,

Peo Sjoblom

"Sarah" wrote in message
...
I am sorry that is what I meant - 12:30pm

"Joel" wrote:

Lunch in time is 12:30 am instead of 12:30 PM

"Sarah" wrote:

I have created a time card where employees choose from a
drop down
box
what
time the started, time they left for lunch, returned for
lunch,
and
then left
to go home. I have the time in the following columns

C D E F
G
16 Time In Lunch Out Lunch In Time Out Total Hours
Worked

I have the following function in G16:
=IF(((D16-C16+(C16D16)+F16-E16+(E16F16))*24)8,"ERROR -
Please
check
your
hours.",((D16-C16+(C16D16)+F16-E16+(E16F16))*24)).

the purpose it to not allow employees to enter more than 8
hours
per
day and
make them enter a time for all four cells. However we are
getting
errors for
such things as:
C D E F
16 8:15am 11:30am 12:30am 5:15pm

Please advise.








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
calculating timesheet, time-in/time-out = total hours & minutes, . Steve Lindsay Excel Worksheet Functions 13 November 8th 06 03:45 PM
How do you subtract time as in a timecard to calculate hours work Dave Davis Excel Worksheet Functions 2 September 18th 06 05:58 PM
Calculating days & time left from start date/time to end date/time marie Excel Worksheet Functions 7 December 7th 05 02:36 PM
How do I use the timecard template if I am using a time clock and. Gargi Upadhyaya New Users to Excel 1 March 11th 05 04:07 PM
Calculating effective time from start/end date+time Stefan Stridh Excel Worksheet Functions 8 November 27th 04 03:50 PM


All times are GMT +1. The time now is 12:45 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"