Using more than one OR Statement

C

Colin Weir

Hi there

I am working on producing a time sheet for my work. I have the
following function happening in a box :

=IF(OR(B12="A/L",B12="S/L",B12="P/H",B12="FLEXI"),7/24,C12-B12-D12)

where B12 = time started, C12 = time finished and D12 = length of
unpaid breaks.

Currently if someone puts either A/L, S/L, P/H or FLEXI it will show
the value of 7.00 in the total colomn.

What I would like to happen is that is somoene inputs "FLEXI" to the
box that the value 0.00 would be shown. Reason being that tthis is
time that a staff member is owed and has to come off their total.

Hope someone can help with this.

Thanks

Colin
 
P

Pete_UK

Try this:

=IF(B12="FLEXI",0,IF(OR(B12="A/L",B12="S/L",B12="P/H"),7/24,C12-B12-
D12))

Hope this helps.

Pete
 
J

Joe User

Colin Weir said:
=IF(OR(B12="A/L",B12="S/L",B12="P/H",B12="FLEXI"),7/24,C12-B12-D12) [....]
What I would like to happen is that is somoene inputs
"FLEXI" to the box that the value 0.00 would be shown.

=IF(OR(B12={"A/L","S/L","P/H"}), 7/24, IF(B12="FLEXI",0,C12-B12-D12))

Perhaps the following will be more-forgiving of future changes:

=IF(ISNUMBER(B12), C12-B12-D12, IF(OR(B12={"A/L","S/L","P/H"}),7/24,0))

which can be simplified further:

=IF(ISNUMBER(B12), C12-B12-D12, OR(B12={"A/L","S/L","P/H"})*7/24)


----- original message -----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top