#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
uw805
 
Posts: n/a
Default dumb question

I feel I should know the answer to this, but I don't, and I can't find it in
excel help.

What does "--" do in a formula?

I've seen it used in a few formulas (sumproduct & mmult specifically), and
I've even used it myself when advised to do so, but I don't quite understand
what it does. Can someone explain?

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Otto Moehrbach
 
Posts: n/a
Default dumb question

It's a shortcut way to convert a text number into a number value. HTH
Otto
"uw805" wrote in message
...
I feel I should know the answer to this, but I don't, and I can't find it
in
excel help.

What does "--" do in a formula?

I've seen it used in a few formulas (sumproduct & mmult specifically), and
I've even used it myself when advised to do so, but I don't quite
understand
what it does. Can someone explain?

Thanks.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default dumb question

See http://www.xldynamic.com/source/xld.SUMPRODUCT.html for a detailed
explanation.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"uw805" wrote in message
...
I feel I should know the answer to this, but I don't, and I can't find it

in
excel help.

What does "--" do in a formula?

I've seen it used in a few formulas (sumproduct & mmult specifically), and
I've even used it myself when advised to do so, but I don't quite

understand
what it does. Can someone explain?

Thanks.



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
 
Posts: n/a
Default dumb question

-- is used when the function returns values of TRUE or FALSE, but you
need to do math on these results - it works like this

the first - forces Excel to convert the true and false to the numeric
equivalents - but of the OPPOSITE state (so true is now numeric 0 and
false is numeric 1). The second minus converts them BACK again - so 0
is now 1 and 1 is now 0 - this now means that in a function like
=sumproduct(--(a1:a1010),--(b1:b10<90),c1:c10)

you will get results like
=1*1*ValueInC
if the first two conditions are true

or
=0*1*valueInC
if the first condition is false (extend this as you need to!!!)


uw805 wrote:
I feel I should know the answer to this, but I don't, and I can't find it in
excel help.

What does "--" do in a formula?

I've seen it used in a few formulas (sumproduct & mmult specifically), and
I've even used it myself when advised to do so, but I don't quite understand
what it does. Can someone explain?

Thanks.


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dave Peterson
 
Posts: n/a
Default dumb question

-True becomes -1 (not 0)
--True becomes 1

-False becomes 0
--False stays 0



" wrote:

-- is used when the function returns values of TRUE or FALSE, but you
need to do math on these results - it works like this

the first - forces Excel to convert the true and false to the numeric
equivalents - but of the OPPOSITE state (so true is now numeric 0 and
false is numeric 1). The second minus converts them BACK again - so 0
is now 1 and 1 is now 0 - this now means that in a function like
=sumproduct(--(a1:a1010),--(b1:b10<90),c1:c10)

you will get results like
=1*1*ValueInC
if the first two conditions are true

or
=0*1*valueInC
if the first condition is false (extend this as you need to!!!)

uw805 wrote:
I feel I should know the answer to this, but I don't, and I can't find it in
excel help.

What does "--" do in a formula?

I've seen it used in a few formulas (sumproduct & mmult specifically), and
I've even used it myself when advised to do so, but I don't quite understand
what it does. Can someone explain?

Thanks.


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
 
Posts: n/a
Default dumb question

Yes, of course it does - I think my brain stopped working while my
fingers kept typing!
Dave Peterson wrote:
-True becomes -1 (not 0)
--True becomes 1

-False becomes 0
--False stays 0



" wrote:

-- is used when the function returns values of TRUE or FALSE, but you
need to do math on these results - it works like this

the first - forces Excel to convert the true and false to the numeric
equivalents - but of the OPPOSITE state (so true is now numeric 0 and
false is numeric 1). The second minus converts them BACK again - so 0
is now 1 and 1 is now 0 - this now means that in a function like
=sumproduct(--(a1:a1010),--(b1:b10<90),c1:c10)

you will get results like
=1*1*ValueInC
if the first two conditions are true

or
=0*1*valueInC
if the first condition is false (extend this as you need to!!!)

uw805 wrote:
I feel I should know the answer to this, but I don't, and I can't find it in
excel help.

What does "--" do in a formula?

I've seen it used in a few formulas (sumproduct & mmult specifically), and
I've even used it myself when advised to do so, but I don't quite understand
what it does. Can someone explain?

Thanks.


--

Dave Peterson


  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dave Peterson
 
Posts: n/a
Default dumb question

That's never happened to me, well, not in the last 10 minutes!


" wrote:

Yes, of course it does - I think my brain stopped working while my
fingers kept typing!
Dave Peterson wrote:
-True becomes -1 (not 0)
--True becomes 1

-False becomes 0
--False stays 0



" wrote:

-- is used when the function returns values of TRUE or FALSE, but you
need to do math on these results - it works like this

the first - forces Excel to convert the true and false to the numeric
equivalents - but of the OPPOSITE state (so true is now numeric 0 and
false is numeric 1). The second minus converts them BACK again - so 0
is now 1 and 1 is now 0 - this now means that in a function like
=sumproduct(--(a1:a1010),--(b1:b10<90),c1:c10)

you will get results like
=1*1*ValueInC
if the first two conditions are true

or
=0*1*valueInC
if the first condition is false (extend this as you need to!!!)

uw805 wrote:
I feel I should know the answer to this, but I don't, and I can't find it in
excel help.

What does "--" do in a formula?

I've seen it used in a few formulas (sumproduct & mmult specifically), and
I've even used it myself when advised to do so, but I don't quite understand
what it does. Can someone explain?

Thanks.


--

Dave Peterson


--

Dave Peterson
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
Dumb sorting question BT Excel Discussion (Misc queries) 2 April 25th 06 05:52 PM
Dumb VBA question nobbyknownowt Excel Discussion (Misc queries) 0 April 23rd 06 08:12 AM
Very dumb question gregorsamsa Excel Discussion (Misc queries) 2 March 23rd 06 03:15 PM
No Dumb Question darkbearpooh1 Excel Worksheet Functions 1 January 25th 06 03:32 PM
total dumb newbie question ayla Excel Discussion (Misc queries) 1 November 30th 05 03:57 PM


All times are GMT +1. The time now is 08:57 PM.

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"