Match loosely with =SUMIF(A:A,"Calder Paper*",D:D), or clean the names with TRIM.
See it happen
G2=SUMIF(A2:A6,"Calder Paper",D2:D6)| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Supplier | Invoice | Date | Amount | Calder Paper | ||
| 2 | Calder Paper | 4101 | Nov 3 | 1200 | 3300 | ||
| 3 | Osprey Packaging | 4102 | Nov 3 | 850 | |||
| 4 | Calder Paper␣ | 4103 | Nov 4 | 430 | |||
| 5 | Calder Paper | 4104 | Nov 5 | 2100 | |||
| 6 | Calder Paper␣ | 4105 | Nov 6 | 640 |
How to see the space
=LEN(A4)returns 13 and=LEN(A2)returns 12. Same word, one more character.=A2=A4returns FALSE: Excel compares every character.- Turn on a filter on column A: the list shows “Calder Paper” twice. Two entries that look the same never are.
- Check the sum: if your totals per supplier no longer add up to the total of column D, some rows matched nothing.
Three fixes
- Match loosely
=SUMIF(A:A,"Calder Paper*",D:D)returns 4,370. The*matches anything after the name, including the space. With the name in a cell:=SUMIF(A:A,G1&"*",D:D)- Trim in the formula
=SUMPRODUCT((TRIM(A2:A6)="Calder Paper")*D2:D6)returns 4,370 without changing the data. TRIM removes spaces at the start and end- Clean the data
- Add a column with
=TRIM(A2), fill it down, then paste it over column A as values (Home → Clipboard → Paste → Values). Every formula that reads the column is fixed at once
The wildcard has a catch: it also matches longer text that starts the same way. In a status column, =COUNTIF(C:C,"Open*") counts “Open”, “Open ” and also “Opened in error”. In our check it returned 3 where the exact match returned 1. Use it only when no other value starts with the same word, or clean the data instead.
Where the spaces come from
Typical sources are an export from another system, a copy from a web page or email, or someone typing a name. We found no data on how often it happens; what we can say is that nothing in Excel warns you.
What Ghost Sheet doesn’t do
It does not clean your file. It has tasks where a stray space arrives in a later copy of the data, so you learn to write formulas that still work and to check for it.
How we checked
We ran the formulas on this page on the example data in the formula engine Ghost Sheet uses (Univer) on November 24, 2026, except where the page says we could not, and the sheets show the values it returned. That engine is not Microsoft Excel, and we have not re-run these examples in desktop Excel. One known difference: where Excel shows TRUE or FALSE, our engine shows 1 or 0.
Updated