IF Formula Involving Times

cgfrank

Board Regular
Joined
Jun 9, 2014
Messages
51
Hello
I would like to make it so a cell fills in yes or no based on the content of another cell.

Start ShiftEnd ShiftTotal Hours
06:0018:0012:00

<tbody>
</tbody>

Example...
Start LogEnd LogTotal Hrs on LogTime Diff Shift vs LogViolation?
06:0018:0012:000:00No
06:0012:006:006:00Yes
06:0021:0015:00-3:00No

<tbody>
</tbody>

The first table above shows my guys shift time. from 6 am til 6 pm, a total of 12 hours.
The second table shows times recorded on a log. (start time, end time, total hours).
If the value in Time Diff Shift vs Log (which is calculated by subtracting Total Hrs on Log from Total Hrs) is greater than 0:00, fill in Yes.
If its 0:00 or lower, fill in No.
I want the violation column to automatically fill based on the other data
 
Last edited:

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Hi,

Does this help?


Book1
ABCDE
1Start ShiftEnd ShiftTotal Hours
26:0018:0012:00
3
4
5Start LogEnd LogTotal Hrs on LogTime Diff Shift vs LogViolation?
66:0018:0012:000:00No
76:0012:006:006:00Yes
86:0021:0015:00-03:00No
Sheet1
Cell Formulas
RangeFormula
C6=B6-A6
D6=IF(C$2-C6<0,"-"&TEXT(ABS(C$2-C6),"hh:mm"),C$2-C6)
E6=IF(C$2<=C6,"No","Yes")


C6, D6, & E6 formulas copied down
 
Upvote 0

Forum statistics

Threads
1,215,586
Messages
6,125,686
Members
449,249
Latest member
ExcelMA

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