I am trying to create a formula that will calculate a formula one way if a cell has a value of "P" and a different way if the cell has a value of "U". The formula is in a time sheet. If lunch hour is 'P", then it should not subtract the value. If it is "U" it should subtract the value. The formula in Column G is (H1-C1)*24 -F1. Thank you for your help
[TABLE="width: 706"]
<colgroup><col><col span="2"><col><col><col><col></colgroup><tbody>[TR]
[TD][TABLE="width: 706"]
<colgroup><col><col span="2"><col><col><col><col></colgroup><tbody>[TR]
[TD][TABLE="width: 706"]
<colgroup><col><col span="2"><col><col><col><col></colgroup><tbody>[TR]
[TD]C
Starting Time[/TD]
[TD]D
Lunch Start[/TD]
[TD]E
Lunch End[/TD]
[TD]F
Lunch Hour[/TD]
[TD]
G
Paid (P) Unpaid (U)[/TD]
[TD]H
Ending Time[/TD]
[TD]
I
Regular Hours Worked[/TD]
[/TR]
[TR]
[TD="align: right"]8:00 AM[/TD]
[TD="align: right"]12:00 PM[/TD]
[TD="align: right"]12:30 PM[/TD]
[TD="align: right"]0.5[/TD]
[TD] U[/TD]
[TD="align: right"]4:00 PM[/TD]
[TD]
7.5
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD][/TD]
[TD="align: right"][/TD]
[TD]
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="width: 706"]
<colgroup><col><col span="2"><col><col><col><col></colgroup><tbody>[TR]
[TD][TABLE="width: 706"]
<colgroup><col><col span="2"><col><col><col><col></colgroup><tbody>[TR]
[TD][TABLE="width: 706"]
<colgroup><col><col span="2"><col><col><col><col></colgroup><tbody>[TR]
[TD]C
Starting Time[/TD]
[TD]D
Lunch Start[/TD]
[TD]E
Lunch End[/TD]
[TD]F
Lunch Hour[/TD]
[TD]
G
Paid (P) Unpaid (U)[/TD]
[TD]H
Ending Time[/TD]
[TD]
I
Regular Hours Worked[/TD]
[/TR]
[TR]
[TD="align: right"]8:00 AM[/TD]
[TD="align: right"]12:00 PM[/TD]
[TD="align: right"]12:30 PM[/TD]
[TD="align: right"]0.5[/TD]
[TD] U[/TD]
[TD="align: right"]4:00 PM[/TD]
[TD]
7.5
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD][/TD]
[TD="align: right"][/TD]
[TD]
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]