IF, AND, OR Function

T

Tracey

Hello,

I have successfully created the IF / AND function on the following formula:

=IF(AND(A1="Feb 08",B1="Persons Name"),"Clear","Not Clear")

however, when I want to ad another condition to the "AND" part (as below),
the formula stops.

=IF(AND(A1="Jan 08",A1="Feb 08",B1="Persons Name"),"Clear","Not Clear")

do i need to ad an "OR" if I do, where in the formula do I ad it?

Many thanks
Tracey
 
P

Pete_UK

The way you have written this you want A1 to be both Jan 08 and Feb 08
- clearly it can't be both at the same time. Try it this way:

=IF(AND(OR(A1="Jan 08",A1="Feb 08"),B1="Persons Name"),"Clear","Not
Clear")

Hope this helps.

Pete
 
D

David Biddulph

AND(A1="Jan 08",A1="Feb 08",...) would always be false, as A1 cannot be
equal to both values.
I assume that you probably mean =IF(AND(OR(A1="Jan 08",A1="Feb
08"),B1="Persons Name"),"Clear","Not Clear")
 
T

Tracey

Fantastic!!!

thank you!!!!

Pete_UK said:
The way you have written this you want A1 to be both Jan 08 and Feb 08
- clearly it can't be both at the same time. Try it this way:

=IF(AND(OR(A1="Jan 08",A1="Feb 08"),B1="Persons Name"),"Clear","Not
Clear")

Hope this helps.

Pete
 
R

Ron Rosenfeld

Hello,

I have successfully created the IF / AND function on the following formula:

=IF(AND(A1="Feb 08",B1="Persons Name"),"Clear","Not Clear")

however, when I want to ad another condition to the "AND" part (as below),
the formula stops.

=IF(AND(A1="Jan 08",A1="Feb 08",B1="Persons Name"),"Clear","Not Clear")

do i need to ad an "OR" if I do, where in the formula do I ad it?

Many thanks
Tracey

What do you mean by "the formula stops" ?

What, exactly, are you trying to do?

In words, your AND function requires that

A1 = "Jan 08" AND A1 = "Feb 08"

Since A1 cannot be equal to two things at the same time, this must always
evaluate to FALSE.

If you want the condition to be TRUE if A1 equals "Jan 08" OR if A1 equals "Feb
08", then you need to state that.

You will find it helpful to write out exactly what you want in words.

You might wind up with:

AND(OR(a1="Jan 08",a1="Feb 08"),B1="Persons Name")

--ron
 
T

Tracey

Thank you very much!

:)

Pete_UK said:
The way you have written this you want A1 to be both Jan 08 and Feb 08
- clearly it can't be both at the same time. Try it this way:

=IF(AND(OR(A1="Jan 08",A1="Feb 08"),B1="Persons Name"),"Clear","Not
Clear")

Hope this helps.

Pete
 

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