# Use of IF

Copper Contributor

# Use of IF

=IF(B9=0;0;IF(B9='B3'='B2';IF(B9='B4'='B3)))

I get error messages

If a field='B3', I want to replace it with 'B2', if a field ='B4', I want to replace it with'B3*The fields are either blank(emty) =B3 or = B4.

Can you help me?

28 Replies

# Re: Use of IF

Hans,
What you sent me was fine, but when I enter correct formulas i "B9" I get the error message: The formula contains unknown text. Can you help once more?
I try to read about it but to no avail.

# Re: Use of IF

Please send the workbook again, with the formula.

# Re: Use of IF

Hans, I will try again, see attachment. You mentioned in an earlier post:"return the desired values in another range, not in the same range", is this the problem in this case?

# Re: Use of IF

A formula in B9 cannot refer to B9 - that causes a circular reference, as I mentioned that before.

Why don't you use the Replace suggestion that I mentioned in a previous reply:

"You could use the Replace dialog (Ctrl+H).

Select the range.

First, enter B3 in the 'Find what' box and B2 in the 'Replace with' box, then click 'Replace All'.

Next, enter B4 in the 'Find what' box and B3 in the 'Replace with' box, then click 'Replace All'.

Done!"

# Re: Use of IF

Hans, yes, I believe the Replace option is simpler, I think that I inadvertently sent you the whole workbook, instead of one part of it. No problem!

# Re: Use of IF

I understand a formula in B9 causes a circular reference, but where could I put it? Could be useful to know for similar use later.

# Re: Use of IF

Hans,
I used the Replace dialog. It worked just fine, and it saved me a lot of time.

# Re: Use of IF

Good to hear that. Thanks for the feedback.

# Re: Use of IF

@Jeffern wrote:
I understand a formula in B9 causes a circular reference, but where could I put it? Could be useful to know for similar use later.

See the attached version.