top of page

The Double Dash (--) in Excel: What It Is and Why It Matters

ree

If you’ve ever seen two dashes (--) inside an Excel formula and thought “What is that doing?” — you’re not alone.


The double dash, also called the double unary operator, is one of those small Excel tricks that looks strange at first but solves very real problems once you understand it.


Excel doesn’t always treat values the way you expect.


For example:

  • Logical tests return TRUE or FALSE

  • Functions like TEXTAFTER and TEXTSPLIT return text

  • Functions like SUM don’t automatically convert text to numbers


That’s where the double dash comes in.

It tells Excel:

“Treat this like a number.”

A Simple Example

Imagine you have a list of Yes/No values and want to count how many are “Yes”.

=SUM(--(A2:A10="Yes"))

What’s happening:

  1. (A2:A10="Yes") creates TRUE/FALSE values

  2. -- converts them to 1s and 0s

  3. SUM adds them up


No helper columns. No extra steps.


Check out the video below for a demonstration.



EXERCISE FILE:


 
 
 

© 2019 by Office Newb, LLC.

bottom of page