# Formula to calculate # of hours based on date range and employee ID code

1. ## Formula to calculate # of hours based on date range and employee ID code

Fellow EXCELers,

Need help with a formula to calculate the nr of hours for an employee within a specified date range.

Thanks much!  Register To Reply

2. ## Re: Formula to calculate # of hours based on date range and employee ID code

Posting some data would be helpful. You are basically walking into a Mechanic and saying "There is a problem is with the car, thanks!" and then leaving.  Register To Reply

3. ## Re: Formula to calculate # of hours based on date range and employee ID code

New to the forum and not sure how to do that. Sorry!  Register To Reply

4. ## Re: Formula to calculate # of hours based on date range and employee ID code

Click on "Go Advanced" and then click on the paper clip icon at the top.  Register To Reply

5. ## Re: Formula to calculate # of hours based on date range and employee ID code Originally Posted by r0man3 New to the forum and not sure how to do that. Sorry!
Actually, I was thinking even something like:

"For example;
Column A contains the ID number for an employee
Column B contains a start time
Column C contains an end time
Column D contains the date of the shift.

I wish to enter an employee ID into G1, a start time into F1, and an End Time in F2. I need a formula to calculate the number of hours worked by that employee between those two dates"

Can you modify that or something? I mean your original question is similar to posting on here with "i have a question with a formula" and nothing else. It's so vague it would be impossible for someone to give you an accurate response. Type out some requirements, examples of your data, or go to the "go advanced" section and upload a sample file, help us to help you!  Register To Reply

6. ## Re: Formula to calculate # of hours based on date range and employee ID code

Double post  Register To Reply

7. ## Re: Formula to calculate # of hours based on date range and employee ID code

I've attached a sample data of the file i have.  Register To Reply

8. ## Re: Formula to calculate # of hours based on date range and employee ID code

BTW, column A is the employee ID, B is the nr. of hours worked, C is the date  Register To Reply

9. ## Re: Formula to calculate # of hours based on date range and employee ID code

Enter:

Employee ID into F2
Start Date into F3
End Date into F4

This formula into F5:

Let me know if this works for you.  Register To Reply

10. ## Re: Formula to calculate # of hours based on date range and employee ID code

Why the IFERROR?

Here's another one...

=SUMIFS(B1:B19,A1:A19,F2,C1:C19,">="&F3,C1:C19,"<="&F4)  Register To Reply

11. ## Re: Formula to calculate # of hours based on date range and employee ID code

It worked like a charm!! Thanks much!!  Register To Reply

12. ## Re: Formula to calculate # of hours based on date range and employee ID code

You're welcome. We appreciate the feedback! In the menu bar above the very first post select Thread Tools, then select Mark this thread as solved.  Register To Reply