Analistable

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 export
OrderSubtotalDiscountPromo code
O-40110010AUTUMN10
O-402800
O-4036015
O-40412030VIP25
O-405505

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) = '');
Result
order_iddiscountdiscount_pct
O-4031525.0
O-405510.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

Discounts by type
TypeOrdersDiscountShare of all discounts
With a promo code24066.7%
Without a code22033.3%
Total460100%

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) > 0 or 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

Common problems
SymptomCauseFix
Every order flaggedPromo code column misaligned after importCheck headers and column positions
Nothing flaggedDiscount column is textConvert to numbers (VALUE or Text to Columns)
Code present but discount wrongCode valid, amount overriddenCompare 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.

Related guides