Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
max
 
Posts: n/a
Default meaning of -- in the formulas

Hi all,

does anybody know the meaning of "--" in a formula?

for example:
=IF(SUMPRODUCT(--(B4:B5=B5))=1;1;0)


thanks a lot!
Massimo
  #2   Report Post  
keepITcool
 
Posts: n/a
Default

Massimo,

the -- is called a unary minus and used to force a conversion from
booleans to numbers. Many array oriented functions work better with
numbers than with booleans and the guru's have found it faster than n().

--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


max wrote :

Hi all,

does anybody know the meaning of "--" in a formula?

for example:
=IF(SUMPRODUCT(--(B4:B5=B5))=1;1;0)


thanks a lot!
Massimo

  #3   Report Post  
Bob Phillips
 
Posts: n/a
Default

Massimo,

Take a look at http://www.xldynamic.com/source/xld.SUMPRODUCT.html

--

HTH

RP
(remove nothere from the email address if mailing direct)


"max" wrote in message
...
Hi all,

does anybody know the meaning of "--" in a formula?

for example:
=IF(SUMPRODUCT(--(B4:B5=B5))=1;1;0)


thanks a lot!
Massimo



  #4   Report Post  
Aladin Akyurek
 
Posts: n/a
Default

max wrote:
Hi all,

does anybody know the meaning of "--" in a formula?

for example:
=IF(SUMPRODUCT(--(B4:B5=B5))=1;1;0)


thanks a lot!
Massimo


Don't be seduced to invoke SumProduct when unnecessary, even costly...

The goal of your formula can be achieved with...

=IF(COUNTIF(B4:B5,B5)=1;1;0)

Even shorter...

=(COUNTIF(B4:B5,B5)=1)+0

=--(COUNTIF(B4:B5,B5)=1)

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
Problem with named formula's nathan Excel Worksheet Functions 0 January 21st 05 04:07 PM
Formulas Stan Excel Worksheet Functions 3 January 21st 05 02:58 PM
How to make Excel run limited number of formulas on a given worksh John Excel Discussion (Misc queries) 0 January 12th 05 04:29 PM
Way to make Excel only run certain formulas on a worksheet? jrusso Excel Discussion (Misc queries) 0 January 12th 05 04:23 PM
calculating formulas for all workbooks in a folder Chad Excel Worksheet Functions 3 November 13th 04 05:22 PM


All times are GMT +1. The time now is 08:37 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"