# trouble with if and text formula

#### kyle_emp

##### New Member
Hi I'm trying to put together a weekly schedule for work it would show the start time, finish time, and hours daily and then total the hours for the week. to total the hours daily I have been using the formula
=text(d6-c6,"h:mm")
the problem is that after working six hours an employee is allowed an unpaid 30 minute break so I've been trying to nest the previous formula into an if formulawhere if the result of the text formula is greater than 6 hours subtract 30 minutes. My problem is that I'm a novice excel user and still very new to if formulas as a result all I have been sucessful at is generating error messages. Any help would be greatly appreciated.

Many thanks
Kyle

### Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

#### P Sitaram

##### Well-known Member
If A2 has the start time and B2 the finish time:

=B2-A2-((B2-A2)>=(6/24))*(1/48)

If there is a possibility of date change i.e., finish time being smaller than the start time, use:

=B2-A2+(A2>B2) -((B2-A2)>=(6/24))*(1/48)

You do not need to use the TEXT function. Just format the cell "h:mm"

#### kyle_emp

##### New Member
Thanks, every thing seems to be working fine

Kyle

Replies
3
Views
2K
Replies
3
Views
1K
Replies
3
Views
796
Replies
1
Views
883
Replies
4
Views
394

1,181,614
Messages
5,930,929
Members
436,767
Latest member
Langaws

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