The Double Dash (--) in Excel: What It Is and Why It Matters
- Kyle Pew
- 1 hour ago
- 1 min read

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:
(A2:A10="Yes") creates TRUE/FALSE values
-- converts them to 1s and 0s
SUM adds them up
No helper columns. No extra steps.
Check out the video below for a demonstration.
EXERCISE FILE: