Clearing scheduled work hours for weekends.

B

Baffled

Hi there
I would use this formula
=IF(B1="sat",0,IF(B1="sun",0,7.5))

See if that works
D
 
D

David Biddulph

Does B1 actually contain the text "Sat", or is it a date formatted as ddd?
If the latter, change Shane's formula from
=IF(OR(B1="Sat",B1="Sun"),0,7.5)
to
=IF(OR(TEXT(B1,"ddd")="Sat",TEXT(B1,"ddd")="Sun"),0,7.5)
 
T

Tom Hutchins

Shane's formula works if your DAYs are text values or date values formatted
using the TEXT function. If, instead, your DAYs are actual date values
displayed using custom formats, then a formula like this should work:

=IF(OR(WEEKDAY(B1)=1,WEEKDAY(B1)=7),0,7.5)

This assumes that the first day is in cell B1.

Hope this helps,

Hutch
 
S

ShaneDevenshire

Hi,

As correctly stated by a number of responders, the formula will work IF your
cells really contain Sat and Sun as mentioned in the original email.

If the entries are actual dates then here is a really short formula:

=IF(MOD(A1,7)>1,7.5,0)
 
T

Teethless mama

This one even shorter.

=(MOD(A1,7)>1)*7.5


ShaneDevenshire said:
Hi,

As correctly stated by a number of responders, the formula will work IF your
cells really contain Sat and Sun as mentioned in the original email.

If the entries are actual dates then here is a really short formula:

=IF(MOD(A1,7)>1,7.5,0)
 

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