Which orders got a discount without a promo code?
By the Analistable team · Updated · 3 min read
Filter the orders export for discount greater than zero and promo code empty. Watch for empty strings as well as true blanks. In the example, O-403 (25% off) and O-405 (10% off) were discounted without a code — likely manual overrides to explain or approve.
Part of our guide: How to answer questions across multiple spreadsheets
The data
| Order | Subtotal | Discount | Promo code |
|---|---|---|---|
| O-401 | 100 | 10 | AUTUMN10 |
| O-402 | 80 | 0 | |
| O-403 | 60 | 15 | |
| O-404 | 120 | 30 | VIP25 |
| O-405 | 50 | 5 |
In a spreadsheet
=FILTER(Orders[[Order]:[Discount]], (Orders[Discount] > 0) * (TRIM(Orders[Promo code]) = ""), "None")TRIM catches codes that are just a space. Add the discount as a percentage of subtotal to sort by size.
In SQL
SELECT order_id, discount, ROUND(100.0 * discount / subtotal, 1) AS discount_pct
FROM orders
WHERE discount > 0
AND (promo_code IS NULL OR TRIM(promo_code) = '');| order_id | discount | discount_pct |
|---|---|---|
| O-403 | 15 | 25.0 |
| O-405 | 5 | 10.0 |
Next steps
- Join to the staff or channel column to see who applied manual discounts.
- Check codes against your list of valid promotions too — a code that isn't on the list (or expired) is another kind of leak:
COUNTIF(Promos[Code], [@Code]) = 0. - Total the discounts given without codes per month to see whether it's a pattern or a few exceptions.
Ask it in Analistable: “Which orders had a discount but no promo code, and who processed them?”
In Google Sheets
=QUERY(Orders!A2:D, "select A, C where C > 0 and (D is null or D = '')", 0)QUERY's is null catches empty cells; D = '' catches cells holding an empty string. Put both in the condition, as here, or some orders slip through.
Turn it into a monthly control
- Add the month to the export and pivot discounts without a code by month and by channel. A rising line is the signal — a few overrides for damaged goods are normal.
- Ask your platform for the staff member or channel on each order; most manual discounts trace back to a handful of people or one integration.
- Agree a rule with the team (for example: manual discounts above 10% need a reason code) and add the reason column to the check.
Size of the leak in the example
| Type | Orders | Discount | Share of all discounts |
|---|---|---|---|
| With a promo code | 2 | 40 | 66.7% |
| Without a code | 2 | 20 | 33.3% |
| Total | 4 | 60 | 100% |
Four of five orders were discounted (O-402 had none). A third of the discount value had no code behind it. Tracking this share month by month is more telling than the raw amount, which rises and falls with sales.
Edge cases that cause false alarms
- Automatic discounts: many shop platforms let you run discounts that apply without a code, and those orders show a discount with an empty code column. Exclude them by the discount title or type column if your export has one.
- Negative numbers: some exports store discounts as negative values. Use
ABS(discount) > 0or flip the sign first. - Line-level discounts: if the discount is on order lines, sum it per order before filtering, or one order appears several times.
- Price overrides: a lowered unit price may not show as a discount at all — compare the charged price with the list price as a second check, as in comparing two price lists.
Excel 2019 and older
Add a helper column =AND(C2 > 0, LEN(TRIM(D2)) = 0) and filter on TRUE with AutoFilter. LEN(TRIM()) returns 0 for blanks, empty strings and cells holding only spaces, so all three are caught. The same helper works in Excel for Mac and Google Sheets.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
| Every order flagged | Promo code column misaligned after import | Check headers and column positions |
| Nothing flagged | Discount column is text | Convert to numbers (VALUE or Text to Columns) |
| Code present but discount wrong | Code valid, amount overridden | Compare discount with the promotion's rate |
Frequently asked questions
- How do I find discounts without a promo code?
- Filter orders where the discount is above zero and the promo code is blank or only spaces.
- Why does my filter miss some orders?
- The promo code cell contains a space or an empty string rather than a true blank. Use TRIM(...) = "".
- How do I check codes are valid?
- Match each order's code against your list of active promotions and flag codes with no match.
- Are automatic discounts a problem?
- No, if they were set up on purpose. Exclude them by their title or type so the check only shows manual or unexplained discounts.