if function not working

  • Thread starter Thread starter crapit
  • Start date Start date
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>?
 
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.
 
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
 
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
 
With text comparisons like this, excel doesn't care about case.

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

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

Back
Top