• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Double Hyphen in Excel Function

Hi Guys,

I am very much confused with the usage of doublt hyphen(--) in excel formula's. Can any one explain.. whats use of it and how to use it?

Thanks a ton!
 
Hi Mahantesh,

Welcome to the forum.

-- is double negation operator. This is journally used to convert TRUE & False to 1 and 0 respectively.

for e.g. C1:C5 = G1, if you are using such comparison it will result in an array of TRUE & FALSE like {TRUE;TRUE;FALSE;TRUE;FALSE}, but if you use --(C1:C5=G1) it will give an array of 1 & 0 {1;1;0;1;1}.

This is one of the way to convert. If you do any aritmetic operation on comparison operators like (C1:C5=G1)*1, this will also converts the TRUE & FALSE's to 1 & 0.

Regards,
 
Back
Top