if function not working

C

crapit

Suppose that a3 is a date that has format dd/mm/yy, b3 format (dddd)

cell of B3 =A3 (B3 value = sunday)

cell of F3 =if(B3 = "sunday", "Void"), iget a 0 instead of value Sunday.
Anyting wrong>?
 
D

Dave Peterson

The underlying value in B3 is still the whole date. You've just formatted it to
look like "Sunday".

(You could drop B3 and just check A3, too.)

=if(weekday(A3)=1,"Void","Not void")
or
=if(text(a3,"dddd")="Sunday","Void","not void")

Or you could hide that "else" portion
=if(weekday(A3)=1,"Void","")
or
=if(text(a3,"dddd")="Sunday","Void","")

Change A3 to B3 in any of those formulas if you want to keep B3 around.
 
B

Billy Liddel

crapit said:
Suppose that a3 is a date that has format dd/mm/yy, b3 format (dddd)

cell of B3 =A3 (B3 value = sunday)

cell of F3 =if(B3 = "sunday", "Void"), iget a 0 instead of value Sunday.
Anyting wrong>?
You do not need an if function; in B3 type =A3 and format it as ddd to
return Sun or dddd to return Sunday.

You could also use Weekday(A3) which will return 1 - to 7 unless you format
it as above.

Peter
 
E

Erny

Hi,

You could use in F3 the following formula:

=IF(TEXT(A3,"dddd")="Sunday","Void")

Beware that "Sunday" is written with an upper-case "S"!

Kind regards,
Erny
 
D

Dave Peterson

With text comparisons like this, excel doesn't care about case.

If the case is important, excel has another function =exact().
 
Top