Problem with If statement

S

SOS

Hi All,

I'm currently working with a spreadsheet that shows the followin
information:

F2 - Ist Contact Date
G2 - Days Waited for Appt
H2 - Discharge Date

and I would like some help to fill in Column I with one of thre
possibilities:

"Waiting"
"Seen"
"Rejected"

The formula to be placed in I2 would have to do the following:

If F2 (Contact Date) is blank AND H2 (Discharge Date) is blank
"Waiting"

If F2 (Contact Date) is not blank AND H2 (Discharge Date) is blank
"Seen"

If F2 (Contact Date) is blank AND H2 (Discharge Date) is not blank
"Rejected"

I know how to do any one of the three formulae but not how to combin
them.

I'd be grateful for any assistance in this

Many thanks in advance

Seamu
 
A

Andrew

Is this what you are after?

=IF(AND(F2="",H2=""),"Waiting",IF(AND(F2<>"",H2=""),"Seen",IF(AND(F2="",H2<>""),"Rejected","")))

If none of the conditions are met, this formula returns a blank. (Yo
can insert a message into the quotation marks at the end if you prefer
 
S

SOS

Andrew,

Excellent!. That works a treat - and I even managed to add in one mor
condition to show "Seen and Discharged" as well.

Thanks again

Seamu
 
A

AlfD

Hi!
One of numerous ways:

Nested IFs, if you want to look it up.

Take the first test:

=if(AND(F2="",H2=""),"Waiting","")

In plain language: if F2 and H2 are both blank put Waiting" in I
otherwise put nothing in I2

Now take that "otherwise" part and substitute another test:

=if(AND(F2="",H2=""),"Waiting",if(AND(F2<>"",H2=""),"Seen","")).

In plain language: if F2 and H2 are both blank put "Waiting" in I
otherwise if F2 is not blank and H2 is blank put "Seen"" in I
otherwise put nothing in I2.

Now do the same with the final test.

=if(AND(F2="",H2=""),"Waiting",if(AND(F2<>"",H2=""),"Seen",if(AND(F2="",H2<>""),"Rejected",""))).

Al
 
J

Jason Morin

=IF(COUNT(F2,H2)=0,"Waiting",IF(AND
(F2<>"",H2=""),"Seen",IF(AND
(F2="",H2<>""),"Rejected","Error")))

HTH
Jason
Atlanta, GA
 
Top