# Need help writing an "If" formula in Excel 2010

Discussion in 'Business Applications' started by McNaughton, Dec 28, 2010.

Not open for further replies.

Joined:
Nov 7, 2010
Messages:
5
Here is what I am trying to do in Excel 2010:

If cell T9 is Yes then cell X9 will go blank.

Any help would be greatly appreciated.

Thanks

Joined:
Apr 11, 2009
Messages:
5,467
First Name:
Josiah
The format for the if statement is
=If(Condition, Response if true, Response if false)

I would put this in X9
=If(T9="yes", "", value currently in X9)

3. ### slurpee55

Joined:
Oct 20, 2004
Messages:
7,837
The last part of your formula is a circular statement, Ent. You can't have X9 look for the value in X9 and return it.
So the first half is fine, but for the latter you need a different value - "no" - for instance. Or possibly you meant
=IF(T9="yes","",T9) ?

Joined:
Apr 11, 2009
Messages:
5,467
First Name:
Josiah
I wouldn't have the reference X9, but the value that is currently in X9.
For example if X9 is normally meant to be set to 7 (when T9 isn't yes), my formula would become
=If(T9="yes", "", 7)
Actually it works for a formula too: if X9 is meant to be set to =A9*4 (when T9 isn't yes), my formula would become
=If(T9="yes", "", A9*4)

As you note the formula =If(T9="yes", "", X9) is very much circular

5. ### slurpee55

Joined:
Oct 20, 2004
Messages:
7,837
Ent, you stated
But that makes the value currently in X9 "=If(T9="yes", "", value currently in X9)" - a circular formula. So that formula may not go into X9, period. That is my problem with your statement.

Joined:
Apr 11, 2009
Messages:
5,467
First Name:
Josiah
Copying and pasting the value currently in X9 into the formula is different from placing the cell reference "X9" in the formula. I don't see a problem with the former.

Let us say X9 has a value of 7.
The value currently in X9 it is 7
The formula I gave becomes =If(T9="yes", "", 7)
That is not circular.

7. ### slurpee55

Joined:
Oct 20, 2004
Messages:
7,837
If you mean X9 currently has, say, 7 in it and you change the formula to read =If(T9="yes", "", 7), then sure, that works.
But generally one writes formulas to change dynamically - it would be better to leave X9 with the value of 7 and in Y9 enter the formula =If(T9="yes", "", X9).

As Seen On