XLsfunctions

F

fati

I need a function in XLs that works as below
return 0 if 0<my number<0.5
return 1 if 0.5<my number<1
 
T

Teethless mama

Assuming your number between 0 and 1

=IF(AND(A1>0.5,A1<1),1,0)
or
=(A1>0.5)+0
 
B

BoniM

You didn't say what you wanted to happen if other values were entered, nor if
the value is 0.5.
The following will return the text "Out of range" for any value 0 or below,
1 and above or for exactly 0.5:
=IF(AND(F4>0,F4<0.5),0,IF(AND(F4>0.5,F4<1),1,"Out of Range"))

To return 1 for 0.5:
=IF(AND(F4>0,F4<0.5),0,IF(AND(F4>=0.5,F4<1),1,"Out of Range"))

To return 0 for 0.5:
=IF(AND(F4>0,F4<=0.5),0,IF(AND(F4>0.5,F4<1),1,"Out of Range"))
 
D

David Biddulph

=ROUND(A1,0) would do it, but you haven't said what you want to happen if
your number is equal to 0.5, or <=0, or >=1.
 
Top