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.
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Try this:

=IF(E2="Absent",8,IF(E2="Arrived Late",F2-I2,IF(E2="Left Early",L2-G2,0)))
1614134718766.png

Thank you for your quick response! I just had a question on how Column H (Total Hours/Minutes Misses) should be formatted. Arrived Late and Left Early need to be calculated as hours and minutes (Ex. Arrived Late 2.00). Do you know how to fix this?
 
Upvote 0
1614137375811.png

This was the result, do you know what step I'm missing? Do I need to change the formula?
 
Upvote 0
Line 4 looks correct. It displays 25 minutes (5:00 - 4:35) I need to see the formula in line 3. That should show 2:00 for 2 hours. Line 1 should show 8:00. Can you confirm that there are no trailing spaces in the E column? If you have "Absent " vs. "Absent", it will not return anything.
 
Upvote 0
Line 4 looks correct. It displays 25 minutes (5:00 - 4:35) I need to see the formula in line 3. That should show 2:00 for 2 hours. Line 1 should show 8:00. Can you confirm that there are no trailing spaces in the E column? If you have "Absent " vs. "Absent", it will not return anything.
1614138123444.png

I'm sorry you were right regarding "Arrived Late"(I had a space after Late), but Absent didn't change after I made the correction.
 
Upvote 0
View attachment 32914
I'm sorry you were right regarding "Arrived Late"(I had a space after Late), but Absent didn't change after I made the correction.
Also 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.
1614138560509.png
 
Upvote 0
Oops. Change the 8 to 1/3. The format uses a 24 hour day, so to show 8 hours, you'd have to enter 1/3.

=IF(E2="Absent",1/3,IF(E2="Arrived Late",F2-I2,IF(E2="Left Early",L2-G2,0)))
 
Upvote 0

Forum statistics

Threads
1,223,162
Messages
6,170,432
Members
452,326
Latest member
johnshaji

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