#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default 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

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 353
Default 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

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default 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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 04:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"