#1   Report Post  
Posted to microsoft.public.excel.misc
NWO NWO is offline
external usenet poster
 
Posts: 60
Default Formula question

Can somebody please explain what the puprose is of the -- in the following
formula?

=SUMPRODUCT(--(ISNUMBER(C5:C61)),--(MONTH(C5:C61)=2))

Thank you.

Mark
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 964
Default Formula question

Basically, the easy answer is that -- is the same as multiplying the result
by -1 twice. So why do this?

ISNUMBER(C5) returns either TRUE or FALSE. Neither of which are usable by
SUMPRODUCT. SUMPRODUCT needs numbers. Excel does equate FALSE to 0 and TRUE
to 1. So, by multiplying TRUE or FALSE by -1 twice you get:

0 x -1 x -1 = 0
1 x -1 x -1 = 1

You now have either a 0 or a 1 that SUMPRODUCT can work with.

HTH
Elkar


"NWO" wrote:

Can somebody please explain what the puprose is of the -- in the following
formula?

=SUMPRODUCT(--(ISNUMBER(C5:C61)),--(MONTH(C5:C61)=2))

Thank you.

Mark

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,572
Default Formula question

http://www.mcgimpsey.com/excel/formulae/doubleneg.html

http://www.xldynamic.com/source/xld.SUMPRODUCT.html



--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"NWO" wrote in message
...
Can somebody please explain what the puprose is of the -- in the following
formula?

=SUMPRODUCT(--(ISNUMBER(C5:C61)),--(MONTH(C5:C61)=2))

Thank you.

Mark



  #4   Report Post  
Posted to microsoft.public.excel.misc
NWO NWO is offline
external usenet poster
 
Posts: 60
Default Formula question

Thank you very much for the explanation.

Mark :)

"Elkar" wrote:

Basically, the easy answer is that -- is the same as multiplying the result
by -1 twice. So why do this?

ISNUMBER(C5) returns either TRUE or FALSE. Neither of which are usable by
SUMPRODUCT. SUMPRODUCT needs numbers. Excel does equate FALSE to 0 and TRUE
to 1. So, by multiplying TRUE or FALSE by -1 twice you get:

0 x -1 x -1 = 0
1 x -1 x -1 = 1

You now have either a 0 or a 1 that SUMPRODUCT can work with.

HTH
Elkar


"NWO" wrote:

Can somebody please explain what the puprose is of the -- in the following
formula?

=SUMPRODUCT(--(ISNUMBER(C5:C61)),--(MONTH(C5:C61)=2))

Thank you.

Mark

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Formula Question Secret Squirrel Excel Discussion (Misc queries) 7 July 28th 08 08:24 AM
formula question Brayden Excel Discussion (Misc queries) 3 June 8th 08 01:39 AM
Formula Question Thomas Excel Worksheet Functions 3 December 20th 07 02:35 PM
MID formula question Brian Excel Worksheet Functions 2 October 24th 07 02:50 PM
Newbie Question - Subtraction Formula Question [email protected] Excel Discussion (Misc queries) 3 May 5th 06 05:50 PM


All times are GMT +1. The time now is 12:01 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"