# Formula help

#### paccali

##### New Member

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

### Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"

#### truebluewoman

##### New Member
I haven't given up on you. Still trying to figure out a rule that works for all .

#### truebluewoman

##### New Member
One last question: What would you want to see if someone arrived at 12:45 PM?

#### paccali

##### New Member
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
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)))))``

#### paccali

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

Replies
6
Views
80
Replies
1
Views
488
Replies
3
Views
170
Replies
2
Views
94
Replies
1
Views
152

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.

1,152,486
Messages
5,770,373
Members
425,612
Latest member
martinijr

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

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