Quick Question If Statement

fenhow

Registered User.
Local time
Today, 12:27
Joined
Jul 21, 2004
Messages
599
Hi, I have hit a road block and am hopeful someone can iron it out.
Quite simple I think.

I have this formula and it works great,
=IF(D2=FALSE,"","Notify Before Initial Entry")

What I am trying to do is add another criteria in the same cell as this formula to show the following

=IF(E2=FALSE,"","Notify Each Phase")

So in the cell I would like
=IF(D2=FALSE,"","Notify Before Initial Entry"), =IF(E2=FALSE,"","Notify Each Phase") etc..

But when I run it it erros..
Any suggestions?
Thanks.

I have attached a screen shot..
Fen
 

Attachments

  • IFSTMNT.jpg
    IFSTMNT.jpg
    104 KB · Views: 242
You want something like this.
Code:
= IF(D2=TRUE, "Notify Before Initial Entry", IF(E2=TRUE, "Notify Each Phase", ""))
 
Paul, thank you. Yes that is what I want but when I do that it only shows the value of the first IF statement. See attached Screenshots. 1 is code, 2 is result.
Thanks.
Fen
 

Attachments

  • 1.JPG
    1.JPG
    61.6 KB · Views: 187
  • 2.JPG
    2.JPG
    52.1 KB · Views: 179
= IF(D2=TRUE, "Notify Before Initial Entry", IF(E2=TRUE, "Notify Each Phase", ""))
I tested it with D2/E2 having a True/False, True/True, False/False, and False/True
pr2-eugin's code works fine for me.

Couldn't help but notice Excel has a Switch function for VBA code.
While it appears to work in the Excel formula bar, the Switch formual wont work there. Too bad. It basically makes the nested IF very simple to write.
 
Ok Thank you. I am not sure what I am doing wrong. I simply copy and paste the code just as shown, when you run it are you getting it to show:

Notify Before Initial Entry, Notify Before Each Phase

Mine just shows "Notify Before Initial Entry"

Many thanks.
Fen
 

Attachments

  • 3.JPG
    3.JPG
    61.1 KB · Views: 171
Do you want to AND the two criteria or OR them. Can either exist without the other and if so what results do you want
Ie can you have any combination of True False?
As the statement is written the second if is only tested if the first is False.

Brian
 
Ok got a bit more time

I suspect from looking at your first attachment that you want something along the lines of

=IF(AND(D1=TRUE,E1=TRUE),"A,B",IF(D1=TRUE,"A",""))

Brian
 

Users who are viewing this thread

Back
Top Bottom