# If Then Statements (Excel)

How do I phrase this in a way that Excel likes?

IF(P6=Null),THEN(Q6=R6
###### 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.

Braces MediaCommented:
``````=if(P6='', Q6=R6, '?');
``````
the syntax is
``````=if(condition, true result, false result)
``````
0
Commented:
Is this in cell Q6?
You will also need to specify a false condition... what to place if P6 isn't blank.

In cell Q6:
=if(p6="", R6,"")

If P6 is blank, then q6=r6. Otherwise, q6 is blank.
0

Experts Exchange Solution brought to you by

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

IT Services ConsultantCommented:
Hi,

Further to the two responses above, as an in-cell formula in cell [Q6]:

=IF(ISBLANK(P6),R6,P6)

If [P6] is 'empty' (blank), then [Q6] is set to the value of [R6], otherwise [Q6] is set to [P6].

However, in Microsoft Visual Basic for Applications:

------------------------------------------------------
If IsNull([P6]) Then
[Q6] = [R6]
Else
[Q6] = [P6]
End If

------------------------------------------------------
or
------------------------------------------------------
[Q6] = IIf(IsNull([P6]), [R6], [P6])
------------------------------------------------------
or
------------------------------------------------------
If IsEmpty([P6]) Then
[Q6] = [R6]
Else
[Q6] = [P6]
End If

------------------------------------------------------
or
------------------------------------------------------
[Q6] = IIf(IsEmpty([P6]), [R6], [P6])
------------------------------------------------------

The usage of IsNull() or IsEmpty() will depend on the data format/type expected in cell [P6].

Perhaps you could elaborate on this please.

BFN,

fp.
0
IT Services ConsultantCommented:
You're welcome.
0
###### It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Applications

From novice to tech pro — start learning today.