Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Yesterday I saw an Excel function that had two hyphens "--" before the
function name. I do remember reading about this a few months ago but I do not remember the use. I was NOT double negation as I remember well. There was another obscur use. Anybody has an idea? Thanks -- Daniel |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]() To convert True to 1 and False to 0 so that maths can be done on them. -- p45cal *p45cal* ------------------------------------------------------------------------ p45cal's Profile: http://www.thecodecage.com/forumz/member.php?userid=558 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=126935 |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
The double negation (changes the sign from positive to negative and
then negative to positive) is one way to convert the TRUE or FALSE result of a comparison operation to the numeric equivalent (TRUE = 1, FALSE = 0). Basically, it multiplies the TRUE or FALSE by -1 twice, which forces Excel to change the value to a number. Cordially, Chip Pearson Microsoft Most Valuable Professional Excel Product Group, 1998 - 2009 Pearson Software Consulting, LLC www.cpearson.com (email on web site) On Wed, 19 Aug 2009 15:12:24 -0700, dlamarche <Melbourne wrote: Yesterday I saw an Excel function that had two hyphens "--" before the function name. I do remember reading about this a few months ago but I do not remember the use. I was NOT double negation as I remember well. There was another obscur use. Anybody has an idea? Thanks |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
"dlamarche" <Melbourne wrote:
Yesterday I saw an Excel function that had two hyphens "--" before the function name. I do remember reading about this a few months ago but I do not remember the use. I was NOT double negation as I remember well. There was another obscur use. Anybody has an idea? Yes, it __is__ simply double negation. Sometimes it is used to convert "numeric text" or Boolean values (TRUE, FALSE) to bona fide numbers. But any arithmetic operation will do the trick. Double negation per se is not always necessary. For example, consider =TEXT(A1,"hh:mm"), which might be used to round a time value in A1 to the precision of a minute. The TEXT function itself returns a string. If you want a time value (a number), you can use double negation, to wit: =--TEXT(A1,"hh:mm"). But suppose you want to add 1 minute to the rounded time value. It would be sufficient to do: =TEXT(A1,"hh:mm")+TIME(0,1,0). PS: Even where double negation is useful, there are alternatives. =1*TEXT(A1,"hh:mm") is equivalent to =--TEXT(A1,"hh:mm"). |
#5
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Thanks you very much for the info gentlemen. I was very intriged but now it
is clearer. So -- was a double negation after all. Thanks Chip, I visit your site regularly and recommended it to many of my students! -- Daniel "JoeU2004" wrote: "dlamarche" <Melbourne wrote: Yesterday I saw an Excel function that had two hyphens "--" before the function name. I do remember reading about this a few months ago but I do not remember the use. I was NOT double negation as I remember well. There was another obscur use. Anybody has an idea? Yes, it __is__ simply double negation. Sometimes it is used to convert "numeric text" or Boolean values (TRUE, FALSE) to bona fide numbers. But any arithmetic operation will do the trick. Double negation per se is not always necessary. For example, consider =TEXT(A1,"hh:mm"), which might be used to round a time value in A1 to the precision of a minute. The TEXT function itself returns a string. If you want a time value (a number), you can use double negation, to wit: =--TEXT(A1,"hh:mm"). But suppose you want to add 1 minute to the rounded time value. It would be sufficient to do: =TEXT(A1,"hh:mm")+TIME(0,1,0). PS: Even where double negation is useful, there are alternatives. =1*TEXT(A1,"hh:mm") is equivalent to =--TEXT(A1,"hh:mm"). |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel sort ( exclude letters include hyphens)? | Excel Worksheet Functions | |||
How to keep 0 in front of # in excel (ex: 018787766316) | Excel Worksheet Functions | |||
how do i remove telephone number hyphens from a list in Excel? | Excel Discussion (Misc queries) | |||
Does XL2K have "hard hyphens" (non-break hyphens)? | Excel Discussion (Misc queries) | |||
excel front end to access | Excel Discussion (Misc queries) |