# IF statement

Not sure if there are any EE's out there today if there are here is a conundrum for you please [Static Data is a Sheet Name]

I need the formula below to go in Cell G36

if G4 is blank, Blank

If Static Data A26=3 and F36 = Blank, Blank

but

If Static Data A26<>3, N/A

otherwise Blank
Many thanks
###### Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Commented:
=IF(G4="","",if('Static Data'!A26=3,"","N/A"))

Note: your F36 test doesn't seem to be relevant based on your description?
0
Director, Practice Manager and Computing ConsultantCommented:
Rory, I think F36 fits here:

``````=IF(G4="","",if(and('Static Data'!A26=3,'Static Data'!F36=""),"","N/A"))
``````

I'm assuming that, if A26=3 but F36<>"", then "N/A".
0
Commented:
I asked the question so we wouldn't have to assume... :)
0
Author Commented:
hi Phillip, F36 is not in static Data it's in the current sheet so unfortunately it does not work
0
Author Commented:
What I an trying to achieve is

today Is Tuesday so Static Data will show 3 in A26.

for the cell used yesterday it shows as blank because Static Data A26 =3

but I need the cell from yesterday to show as N/A not blank.

That is why the code needs to be
if G4 is blank, Blank

If Static Data A26=3 and F36 = Blank, Blank

but

If Static Data A26<>3, N/A

otherwise Blank
0
Commented:
That's just the same description. ;)

Basically your description says that if G4 is blank, you want blank, then if A26 <>3 you want N/A and for all other outcomes you want blank, so the test on F36 is irrelevant.
0
Director, Practice Manager and Computing ConsultantCommented:
So

``````=IF(or(G4="",'Static Data'!A26=3),"","N/A")
``````

Well, Rory was right. F36 is not relevant, because:

If Static Data A26=3 and F36 = Blank, Blank
but If Static Data A26=3 and F36 is not Blank, then Blank (because it then goes to "Otherwise blank")
0
Author Commented:
Hmm!

But

Today Static Data = 3

but

G4 is not = Blank

F36 is blank

so I need G36 to be N/A
0
Director, Practice Manager and Computing ConsultantCommented:
Doesn't make sense.

This is what you have said: But Today Static Data = 3 but G4 is not = Blank F36 is blank so I need G36 to be N/A

However, what you have previously said:

If G4 is blank, Blank. ELSE If Static Data A26=3 and F36 = Blank, Blank

It seems that it needs to be Blank, based on your previous logic. Please clarify.
0
Author Commented:
I believe these two statements are the same:

if G4 is blank, Blank                                          [so if it's not blank and A26 <>3 then N/A]

If Static Data A26=3 and F36 = Blank, Blank

but

If Static Data A26<>3, N/A

and

Today Static Data = 3

but

G4 is not = Blank

F36 is blank

so I need G36 to be N/A
0
Director, Practice Manager and Computing ConsultantCommented:
In this example, are you saying Static Data A26 = 3 or not?
0
Author Commented:
yes it does because 3 = Tuesday
0
Director, Practice Manager and Computing ConsultantCommented:
Then, let's go through the logic (as far as I can see it)

Condition 1: if G4 is blank, Blank - not true, so go to Condition 2

Condition 2: If Static Data A26=3 and F36 = Blank, Blank - not true, as F36 is not blank, so go to Condition 3

Condition 3: but If Static Data A26<>3, N/A - not true, as A26 = 3, so go to Condition 4.

Condition 4: otherwise Blank - Therefore, the answer is blank.

Otherwise, when would you ever get to condition 4?
0
Author Commented:
today

Condition 2: is true

Condition 2: If Static Data A26=3 and F36 = Blank, Blank - TRUE as F36 is blank,
0
Commented:
F36 is still irrelevant due to your Else clause. The only time you don't return blank is if A26 <> 3.
0
Director, Practice Manager and Computing ConsultantCommented:
Condition 3 is FALSE - Static Data A26 <> 3, so you have to go to Condition 4, based on your logic.
0
Author Commented:
ok yes condition 4
0
Director, Practice Manager and Computing ConsultantCommented:
So, the answer is Blank. So F36 (should that read F26?) is not relevant, because the result from Condition 2 and Condition 4 are the same.
0
Author Commented:
I have just noticed my error, sorry

If Static Data A26=3 and F36 = Blank, Blank should read If Static Data A26=3 and F36 = Blank, N/A
0
Director, Practice Manager and Computing ConsultantCommented:
So, here we go:

``````=IF(G4="","",if(and('Static Data'!A26=3,F36<>""),"","N/A"))
``````
0

Experts Exchange Solution brought to you by