IF formula not working properly (scheduling/ staffing)

SHUTTEHFACE

Board Regular
Joined
Aug 13, 2014
Messages
53
I am using the following to create a schedule that includes breaks and lunches.

[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[/TR]
[TR]
[TD]Start[/TD]
[TD]End[/TD]
[TD]8[/TD]
[TD]8.5[/TD]
[TD]9[/TD]
[/TR]
[TR]
[TD]8.5[/TD]
[TD]17[/TD]
[TD][/TD]
[TD][/TD]
[TD][TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD]=IF(SUM($C$3:D$3)>=2,0.25,IF(AND(E$2>=$A3,E$2<=$B3),0.5,0))
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]

The formula is dragged to the right until Row 2 is 24 (24th hour of the day).

The formula keeps returning 0 and I can't figure out why.

Thanks for the help!

M
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Excel handles times as real numbers (IE decimals) between 0 and 1; where 0 is midnight and 1 is midnight the next day, making 0.5=Noon.


Therefore if you need to measure for two hours, then instead of using 2, use (2/24).


Hope that helps.

/AJ
 
Upvote 0
It works for me, although I'm not sure what should be in cell E2, F2, etc

Excel 2010
ABCDE
StartEnd

<colgroup><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]3[/TD]

[TD="align: right"]8[/TD]
[TD="align: right"]8.5[/TD]
[TD="align: right"]9[/TD]

[TD="align: center"]4[/TD]
[TD="align: right"]8.5[/TD]
[TD="align: right"]17[/TD]
[TD="align: right"]0.25[/TD]
[TD="align: right"]0.25[/TD]
[TD="align: right"]0.25[/TD]

</tbody>
Sheet1

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Worksheet Formulas[TABLE="width: 100%"]
<thead>[TR="bgcolor: #DAE7F5"]
[TH="width: 10"]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
</thead><tbody>[TR]
[TH="width: 10, bgcolor: #DAE7F5"]C4[/TH]
[TD="align: left"]=IF(SUM($C$3:D$3)>=2,0.25,IF(AND(E$2>=$A3,E$2<=$B3),0.5,0))[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]



/AJ
 
Upvote 0
Sorry, this is what I am using:

[TABLE="class: cms_table_grid, width: 500, align: center"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Start[/TD]
[TD]End[/TD]
[TD]8[/TD]
[TD]8.5[/TD]
[TD]9[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]8.5[/TD]
[TD]17[/TD]
[TD]0[/TD]
[TD]0.5[/TD]
[TD][TABLE="class: cms_table_grid, width: 500, align: center"]
<tbody>[TR]
[TD]=IF(SUM($C$2:D$2)>=2,0.25,IF(AND(E$1>=$A2,E$1<=$B2),0.5,0))
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0

Forum statistics

Threads
1,222,143
Messages
6,164,179
Members
451,880
Latest member
2da

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