Can someone explain me this formula

smalik

Board Regular
Joined
Oct 26, 2006
Messages
157
Office Version
  1. 365
Platform
  1. Windows
=SUMPRODUCT(--(A1=sheet!$B$2:$B$5697),--(sheet!$E$2:$E$5697))

Can someone explain to me the significance of -- in the above formula. I remember seeing the -- used in other formulae as well but never understood.

Thanks.
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
The -- is used to coerce arrays of False/True values into the numbers 0/1 that sumproduct can work with.
 
Upvote 0

smalik

Board Regular
Joined
Oct 26, 2006
Messages
157
Office Version
  1. 365
Platform
  1. Windows
The -- is used to coerce arrays of False/True values into the numbers 0/1 that sumproduct can work with.

Thanks. This is helpful but can you give me an example. I am trying to learn this so that I can use it if and when there is a need. Thanks in advance for your help and time.
 
Upvote 0

Forum statistics

Threads
1,195,947
Messages
6,012,470
Members
441,701
Latest member
vnkendijs

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top