Multiple IIf with Is Null

K

Kurt Heisler

=IF(F6="Social Work Supervisor",1,0)

I'm trying to write a function that does enters either a 0, 1, or
blank (i.e., null) value in A2 based on a value in A1.

Basically:

If A1 is null, make A2 = null.
If A1 = "red", make A2 = 1.
If A1 doesn't = "red," make A2 = 0.

I got the syntax for the last two items:

=IF(A1="red",1,0)

How do I add the IsNull portion?

I tried beginning the formula with all sorts of =IIf(IsNull([A1]) ...
permutations but can't seem to get it.

Thanks.
 
T

T. Valko

If A1 is null, make A2 = null.
If A1 = "red", make A2 = 1.
If A1 doesn't = "red," make A2 = 0.

Try this...

=IF(A1="","",--(A1="red"))

--
Biff
Microsoft Excel MVP


Kurt Heisler said:
=IF(F6="Social Work Supervisor",1,0)

I'm trying to write a function that does enters either a 0, 1, or
blank (i.e., null) value in A2 based on a value in A1.

Basically:

If A1 is null, make A2 = null.
If A1 = "red", make A2 = 1.
If A1 doesn't = "red," make A2 = 0.

I got the syntax for the last two items:

=IF(A1="red",1,0)

How do I add the IsNull portion?

I tried beginning the formula with all sorts of =IIf(IsNull([A1]) ...
permutations but can't seem to get it.

Thanks.
 
S

Sane

If A1 is null, make A2 = null.
If A1 = "red", make A2 = 1.
If A1 doesn't = "red," make A2 = 0.

Try this...

=IF(A1="","",--(A1="red"))

--
Biff
Microsoft Excel MVP




=IF(F6="Social Work Supervisor",1,0)
I'm trying to write a function that does enters either a 0, 1, or
blank (i.e., null) value in A2 based on a value in A1.

If A1 is null, make A2 = null.
If A1 = "red", make A2 = 1.
If A1 doesn't = "red," make A2 = 0.
I got the syntax for the last two items:

How do I add the IsNull portion?
I tried beginning the formula with all sorts of =IIf(IsNull([A1]) ...
permutations but can't seem to get it.
Thanks.- Hide quoted text -

- Show quoted text -

try this
=IF(A1="","",IF(A1="red",1,0))
 

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