# 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!

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.

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!

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.

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!

Double post

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.

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

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.

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)

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

It worked like a charm!! Thanks much!!

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.

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1