If Formula

  • Thread starter dazoloko via OfficeKB.com
  • Start date
D

dazoloko via OfficeKB.com

Dear All

I have two columns (A and B) that Contain a "Y" or "N" in column A and a Date
or Blank in Column B.

If A = "Y" and B has a Date in the Result is "OK"
if A = "N" and B has a Date in the Result is "Error"
If A = "Y" and B is Blank the Result is "Error"
If A = "N" and B is Blank the Result is "OK"

I am after a formula which will return an "OK" or "Error" depending on the
conditions above.

Could anyone assist ?

Many Thanks

D
 
M

Mike H

Hi,

Put this in A1 and drag down.

=IF(AND(A1="y",ISNUMBER(B1)),"OK",IF(AND(A1="y",B1=""),"Error",IF(AND(A1="N",ISNUMBER(B1)),"Error",IF(AND(A1="N",B1=""),"OK",""))))

Mike
 
B

Bob Phillips

=IF(OR(AND(A1="Y",ISNUMBER(B1)),AND(A1="N",B1="")),"OK",
IF(OR(AND(A1="N",ISNUMBER(B1)),AND(A1="Y",B1="")),"Error",""))

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
C

Carla

Thank you!!! I searched on a solution to my problem and came across this
posting which COMPLETELY worked for me in a similar situation!!! I learned
something in the process, that *=AND. I never knew that. Thank you muddan
madhu for replying to the person requesting help below! I was going to end
up bald from pulling my hair out trying to complete an "if(or(and" statement,
you saved my locks!

Carla
St. Petersburg, FL
 

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