Unable to excecute formula

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I tried to use functions and had an instant when I type in :

=if(or(A3=A2,A3=A4),1,0)

Excel instead of executing the function and does the comparison, displays
the exact words as above.

How can I get Excel to perform the function as I had wanted?
 
Hi

check tools / options / view tab and ensure that formulas is unticked
it might also be that the cell is formatted to text, choose a blank unused
cell somewhere and copy it, then click on your cell, choose edit / paste
special - ADD. You might then still need to click on the cell press the F2
key and then press enter for it to behave.

Cheers
JulieD
 
When you entered your function, the cell was formatted as Text, so
that's how XL's parser interpreted it. Change the format and re-enter it.

FWIW, your formula could be a bit shorter by using XL's implicit
coercion of TRUE/FALSE to 1/0 in a math operation:

= --OR(A3=A2,A3=A4)

where the first - is used to coerce TRUE/FALSE to -1/0, then the second
- negates the result of the first.

Alternatively:

=(A3=A2)+(A3=A4)

but the -- is somewhat more efficient.
 
Disregard the last - it will return 2 if all three are equivalent.
 
Thanks JE, Julie,

I changed the text format to number format and it works !!
 

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

Back
Top