Change operater in Excel formula

H

H.G. Lamy

Hello,

depending on a certain circumstances, a formula must change from "X = Y" to
"X <> Y".
Can this be done (e.g. using "if", or otherwise) ?
Thank you in advance.
Merry Christmas,

H.G. Lamy
 
R

Rick Rothstein

You didn't give us a lot to work with, but I think you are looking for
something like this...

=IF(<<your condition>>,<<formula with x=y>>,<<formula with x<>y>>)
 
L

Lars-Åke Aspelin

As an alternative, if "the formula" is very long, you may try this:

<< your formula with X=Y replaced with (((X<>Y)+your condition)=1) >>

Hope this helps / Lars-Åke
 
H

H.G. Lamy

Since my formula is already quite long and complicated, I'd like to avoid
repeating most of it (once for the "if"-part, and again for the
"then"-part).

Instead, I was trying to REPLACE ONLY THE OPERATOR INSIDE THE FORMULA ("=",
or "<>", respectively), depending on the condition met.

However, I did not find a workable solution for that.

Can anybody assist ?

Thank you in advance!

Kind regards,

H.G. Lamy
 

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