How do I define the signum function sign(x) in Excel?
I am trying to define the function sign(x) in Excel. Sign (x) = 1 if x0,
sign(x)=0 if x<0 and sign(0)=0. I know that it is probably straightforward to do as an if statement, but I wondered if there is just an explicit function in Excel that would do it for me. |
Hi, You could try something like this: =MAX(SIGN(A1),0) so that your number is in A1. - Asser -- Jazzer ------------------------------------------------------------------------ Jazzer's Profile: http://www.excelforum.com/member.php...fo&userid=4464 View this thread: http://www.excelforum.com/showthread...hreadid=276583 |
Do you really mean sign(x)=0 if x<0? If not (and you meant sign(x)=-1
if x<0), then check XL help for the SIGN function. -- Regards, Tushar Mehta www.tushar-mehta.com Excel, PowerPoint, and VBA add-ins, tutorials Custom MS Office productivity solutions In article , says... I am trying to define the function sign(x) in Excel. Sign (x) = 1 if x0, sign(x)=0 if x<0 and sign(0)=0. I know that it is probably straightforward to do as an if statement, but I wondered if there is just an explicit function in Excel that would do it for me. |
Jonathan,
=IF(x0,1,0) HTH, Bernie MS Excel MVP "Jonathan" wrote in message ... I am trying to define the function sign(x) in Excel. Sign (x) = 1 if x0, sign(x)=0 if x<0 and sign(0)=0. I know that it is probably straightforward to do as an if statement, but I wondered if there is just an explicit function in Excel that would do it for me. |
The sign function is in Excel, but you defined something
like: =--(A10) Regards, Bernd |
All times are GMT +1. The time now is 09:01 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com