If / Then Question

  • Thread starter Thread starter carlo
  • Start date Start date
C

carlo

I am trying to write an if then that will return true if a
number is between or equal to -1 and 1. I imagine this is
pretty easy but I can;t get it to work.

Thanks for your help.
 
Your idea for a formula should be an "if and if" formula
rather than "if and then"
Try this it works
=IF((A1>=-1)*AND(A1<1),TRUE,0)
 
Dave, it works, but it has some unnecessary items...

A1<1

returns TRUE or FALSE

AND(TRUE/FALSE) simply returns TRUE/FALSE, so it's superfluous. use

=IF((A1>=-1)*(A1<=1),TRUE,0)

instead.

Perhaps you were thinking of

=IF(AND(A1>=-1, A1<=1),TRUE,0)

OTOH, if the OP wants a result of TRUE or FALSE, the IF() statement is
unnecessary:

=AND(A1>=-1,A1<=1)
 
Back
Top