paccali

New Member
Joined
Feb 23, 2021
Messages
9
Office Version
  1. 365
  2. 2013
Platform
  1. Windows
  2. MacOS
1614133453253.png

Hello,
I need help formulating. I'm working on an employee attendance sheet. I need to formulate the total hours/minutes missed. If they were Absent it would equal 8 hours; if they Arrived Late the total amount of hours/minutes they missed; if they Left Early the total amount of hours/minutes missed. I just can't figure it out and need some helpful insight.
 

paccali

New Member
Joined
Feb 23, 2021
Messages
9
Office Version
  1. 365
  2. 2013
Platform
  1. Windows
  2. MacOS
One last question...I don't know how get around the issue if they Arrived Late after 1pm how to automatically subtract the 1 hour break so it doesn't equal 5 hours.
1614139022279.png
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.

paccali

New Member
Joined
Feb 23, 2021
Messages
9
Office Version
  1. 365
  2. 2013
Platform
  1. Windows
  2. MacOS
One last question: What would you want to see if someone arrived at 12:45 PM?
Lol I know it gets tricky. If they arrive at 12:45pm they would have skipped the lunch break (basically they would have missed 4 hours, but worked 5.15 hours...but I’ve already made this formula difficult enough; let’s just assume they won’t arrive during the daily break. Thank you again I really appreciate the help.
 

truebluewoman

New Member
Joined
Sep 26, 2014
Messages
34
Okay...This formula will work with the assumption that no one will arrive during the break hour. It uses two conditions for each scenario. Arriving Early before a break and after a break. Leaving Early before and after the break time. Everything else returns 0. Good luck!

Excel Formula:
=IF(E2="Absent",1/3,IF(AND(E2="Arrived Late",F2<=J2),F2-I2,IF(AND(E2="Arrived Late",F2>=J2),J2-I2+F2-K2,IF(AND(E2="Left Early",G2>=K2),L2-G2,IF(AND(E2="Left Early",G2<=J2),L2-K2+J2-G2,0)))))
 
Solution

paccali

New Member
Joined
Feb 23, 2021
Messages
9
Office Version
  1. 365
  2. 2013
Platform
  1. Windows
  2. MacOS
Okay...This formula will work with the assumption that no one will arrive during the break hour. It uses two conditions for each scenario. Arriving Early before a break and after a break. Leaving Early before and after the break time. Everything else returns 0. Good luck!

Excel Formula:
=IF(E2="Absent",1/3,IF(AND(E2="Arrived Late",F2<=J2),F2-I2,IF(AND(E2="Arrived Late",F2>=J2),J2-I2+F2-K2,IF(AND(E2="Left Early",G2>=K2),L2-G2,IF(AND(E2="Left Early",G2<=J2),L2-K2+J2-G2,0)))))
Thank you so much for your help!
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,151,825
Messages
5,766,661
Members
425,367
Latest member
Boboka

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top