ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   what is sgn? (https://www.excelbanter.com/excel-discussion-misc-queries/87258-what-sgn.html)

CJ

what is sgn?
 
A discusion group entry on 4/20 contained the following formula:

q = -(b + sgn(b)*sqrt(b^2-4a*c))*0.5

in relation to the quadratic function.
What is sgn? Does it appear in Excel 2000?
Thanks everyone.
CJ

Ken Johnson

what is sgn?
 
Hi CJ,

sgn is a VB math method that returns -1,0 or 1.
sgn(b) = -1 if b<0, 0 if b=0 and 1 if b0.

I'm pretty sure it would be in all versions of Excel

The Worksheet function equivalent is called SIGN.

Ken Johnson


CJ

what is sgn?
 
Thank you, SIGN is: "Determines the sign of a number. Returns 1 if the
number is positive, zero (0) if the number is 0, and -1 if the number is
negative." quoted from Excel 2000.

Thanks again



"Ken Johnson" wrote:

Hi CJ,

sgn is a VB math method that returns -1,0 or 1.
sgn(b) = -1 if b<0, 0 if b=0 and 1 if b0.

I'm pretty sure it would be in all versions of Excel

The Worksheet function equivalent is called SIGN.

Ken Johnson



Ken Johnson

what is sgn?
 
You're welcome CJ

Ken Johnson



All times are GMT +1. The time now is 07:00 AM.

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