Formula help

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.
 
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
 
Upvote 0

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
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.
 
Upvote 0
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)))))
 
Upvote 0
Solution
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!
 
Upvote 0

Forum statistics

Threads
1,223,975
Messages
6,175,742
Members
452,667
Latest member
vanessavalentino83

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
Back
Top