The # and @ Operators: Serving Up Your Spill

Your formula overflowed. Now let's put that harvest to work.

A cornucopia overflowing onto the Thanksgiving table is a beautiful sight. But eventually someone has to pick up the fruit and put it on plates.

Spill formulas are the same. Once a formula like =SORT(UNIQUE(C5:C24)) spills a list into several cells, you'll want to use that list in other formulas: total it, count it, or turn it into a drop-down. The catch is that the list changes size whenever the data changes. Point to G5:G9 today, and tomorrow's sixth pie gets left off the plate.

This post covers two operators built for working with spills: the Excel spill range operator, #, and its opposite, @. Plus a bonus: the double minus, --, which turns TRUE and FALSE results into numbers you can add up.

New to spill? Start with this month's Toolbox post, Spill: One Excel Formula, a Whole Harvest of Results. Spill formulas need Excel for Microsoft 365, Excel 2021 or later, or Excel for the web.

📥 Practice along with us

Download the free practice workbook and try each tip as you read. Open the Spill Operators sheet for this tip. It uses the same Harvest Bakery pie orders as the Spill Basics sheet: headings in row 4, orders in rows 5 through 24. The Answer Key sheet lets you check your results.

Download the practice workbook (Excel)

1. The Excel Spill Range Operator (#): Point to the Whole Spill

If you put a # after the first cell of a spill range, Excel refers to the entire spill, however big or small it is right now. G5# means "the spill range that starts in G5." Microsoft calls it the spilled range operator.

You rarely have to type the # yourself. When you build a formula and select a whole spill range with your mouse, Excel writes the # reference for you.

Let's build a little summary of pies ordered by flavor. Open the practice workbook and click the Spill Operators sheet tab.

  1. List each pie once, in alphabetical order. In English: "give me the unique pies from the Pie column, then sort them."
    1. In G4, type Pie.
    2. In G5, type =SORT(UNIQUE(
    3. With your mouse, select C5:C24.
    4. Type )) and press Enter. Your formula reads =SORT(UNIQUE(C5:C24)), and five pies spill into G5:G9.
  2. Total the pies ordered for each flavor. In English: "for each pie in my spilled list, add up the quantities of the orders for that pie."
    1. In H4, type Pies Ordered.
    2. In H5, type =SUMIFS(
    3. With your mouse, select D5:D24 (the quantities to add up), then type a comma.
    4. Select C5:C24 (the pie on each order), then type a comma.
    5. Select G5:G9, your whole spilled list. Excel writes G5# for you.
    6. Type ) and press Enter. Your formula reads:
      =SUMIFS(D5:D24, C5:C24, G5#)

Because G5# holds five pies, SUMIFS returns five totals, and they spill down beside the flavors.

G: Pie H: Pies Ordered
Apple9
Cherry6
Pecan8
Pumpkin13
Sweet Potato3

Add a sixth flavor to the orders, and both columns grow together.

Outcome: Your summary always matches the list beside it. No more formulas that stop one row short.

2. Surround the Spill with SUM, COUNTA, and Friends

Any function that works on a range also works with the Excel spill range operator.

  1. Add up all the pies. In English: "add up every total in my Pies Ordered spill."
    1. In J4, type Total Pies.
    2. In J5, type =SUM(
    3. With your mouse, select H5:H9. Excel writes H5#.
    4. Type ) and press Enter. Your formula reads =SUM(H5#), and the result is 39.
  2. Count the flavors. In English: "count how many pies are in my spilled list."
    1. In K4, type Flavors.
    2. In K5, type =COUNTA(
    3. With your mouse, select G5:G9. Excel writes G5#.
    4. Type ) and press Enter. Your formula reads =COUNTA(G5#), and the result is 5.

Why are the totals in their own columns? Why not put them below the unique list of pies? Your pie list in G5:G9 can grow. If you typed a total in G10, right under the list, the day a sixth flavor is added the list would need G10 for the new pie. Your total would be in the way, and the list would show a #SPILL! error. So keep the cells below a spill empty, and put totals beside it or above it instead.

Outcome: Totals and counts that stay correct as the list grows or shrinks, with no ranges to adjust.

3. Serve It as a Drop-Down List That Grows

Here's one of the most useful tricks for the Excel spill range operator: a drop-down list that updates itself.

  1. In J8, type Choose a pie:, then click J9.
  2. On the Data tab, click Data Validation.
  3. Under Allow, choose List.
  4. In the Source box, type:
    =$G$5#
  5. Click OK, then click the arrow beside J9.

The drop-down shows exactly the five pies in your spill. When the bakery adds a new flavor, it appears in the drop-down too, without anyone touching the validation settings.

Outcome: Drop-down lists that stay current on their own, so nobody has to remember to update them.

4. The @ Operator: Just One Helping, Please

If # means "the whole spill," @ means the opposite: "just one value." Its technical name is implicit intersection.

You've probably seen a close cousin already. In an Excel Table, [@Qty] means "the Qty in this row." Same idea: one value from the current row.

Before dynamic arrays, Excel quietly did this on its own. If a formula pointed to a whole column but only had room for one answer, Excel picked the value from the same row as the formula. When spill arrived, Excel needed a way to keep those older formulas working the same way, so it started showing the @ that had always been happening behind the scenes.

That's why you'll most often meet @ when you open a workbook built in an older version of Excel. Try it yourself:

  1. Click M5 and type =C5:C24. Press Enter. All 20 pies spill down the column.
  2. Click M5 again and change it to =@C5:C24. Press Enter.
  3. Only one value appears: Pumpkin, the pie from row 5, the same row as the formula.

What to do when you see @ in an older workbook: usually, leave it alone. It's there to make the formula give the same answer it always did. If you delete it, the formula may suddenly spill or return a different result.

Outcome: That mysterious @ in an old workbook makes sense now, and you know why not to delete it.

5. Bonus: The Double Minus (--)

The double minus isn't a spill operator, but it often shows up in spill-style formulas, so it's worth meeting here. It converts TRUE and FALSE into 1 and 0, numbers you can add up. (Minus once makes TRUE into -1; minus again flips it back to 1.)

  1. Click M5 and replace the formula with:
    =D5:D24>=3
    A column of TRUE and FALSE spills down: TRUE for each order of 3 or more pies.
  2. Change it to:
    =--(D5:D24>=3)
    Now it spills 1s and 0s.
  3. In J12, type Big Orders. In J13, add them up:
    =SUM(--(D5:D24>=3))
    The result is 5.

For a simple condition like this one, =COUNTIF(D5:D24, ">=3") gives the same answer. The double minus earns its keep when COUNTIF can't handle the question. For example, how many pies are being picked up on the Wednesday before Thanksgiving?

  1. In J15, type Wednesday Pickups. In J16, type:
    =SUM(--(TEXT(E5:E24, "ddd")="Wed"))
  2. The result is 12.

In English: "turn each pickup date into its day name, check whether it's Wed, turn each yes into a 1, and add them up." COUNTIF can't convert dates to day names on the way in, but this formula can.

Outcome: You can count almost anything you can describe as a yes-or-no question, even when COUNTIF and COUNTIFS fall short.

Quick Reference

Symbol Means Example
#The whole spill range that starts in this cell=SUM(H5#)
@Just one value, from the formula's own row=@C5:C24
--Turn TRUE and FALSE into 1 and 0=SUM(--(D5:D24>=3))

From Harvest to Table

A spill gives you abundance. The Excel spill range operator lets you gather it up and serve it to the rest of your workbook, the @ explains the older formulas you'll inherit, and the double minus turns yes-or-no questions into numbers. Together, they turn one overflowing formula into a whole report that keeps itself up to date.

Have a workbook that needs to keep up with growing data? Just contact us and we'd be happy to brainstorm ideas with you.