Click here to Skip to main content
15,885,985 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hello guys
I'm having some problems trying to calculate the number of days worked, based on total hours and the hours I work per day.

For example, I work 8 hours a day, and at the end of my job's internship, I have 420 hours. How do I calculate the number of day's I've worked?

What I have tried:

Tried to divide 420 by 8 to get the number os days, and then divide that value with 7 to get the number of weeks.
Posted
Updated 3-May-17 22:41pm
Comments
Patrice T 4-May-17 4:29am    
"Tried to divide 420 by 8 to get the number os days, and then divide that value with 7 to get the number of weeks. "
And what is the problem ?
Richard MacCutchan 4-May-17 4:32am    
Do you really work 7 days each week?
Scribling Doodle 8-May-17 6:43am    
Sorry, didn't have time to come here and respond to you, but the problem was that it was giving me decimal values. I wanted the full week quocient. And with the answer from chill60, I could finally get it working ;)

1 solution

You are right in what you are doing IF you work 7 days a week. Me ..no, I work 5 days a week.

So if cell A2 contains the hours worked you can get the Days worked in cell B2 with the formula
VB
=A2/8
If you want whole days only then make that
VB
=INT(A2/8)
To get the number of weeks worked in cell C2 use formula
VB
=A2/8/5
or if you want whole weeks only use
VB
=INT(A2/8/5)
 
Share this answer
 
Comments
Maciej Los 4-May-17 15:57pm    
Nice.
Scribling Doodle 8-May-17 6:39am    
Yeah, actually some weeks I need to work on the weekend, so even if I do not work on weekends most of the time, the value would be set to 0, and if I work it simply accepts it as a weekday. This worked very well my friend.!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900