ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   XLsfunctions (https://www.excelbanter.com/excel-worksheet-functions/140125-xlsfunctions.html)

fati

XLsfunctions
 
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

Teethless mama

XLsfunctions
 
Assuming your number between 0 and 1

=IF(AND(A10.5,A1<1),1,0)
or
=(A10.5)+0



"fati" wrote:

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


BoniM

XLsfunctions
 
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(F40,F4<0.5),0,IF(AND(F40.5,F4<1),1,"Out of Range"))

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

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

"fati" wrote:

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


David Biddulph[_2_]

XLsfunctions
 
=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.
--
David Biddulph

"fati" wrote in message
...
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





All times are GMT +1. The time now is 12:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com