How to calculate Average Order Value (AOV)
Average order value is the mean amount customers spend per order.
Formula
AOV = total revenue ÷ number of ordersSQL query
This example assumes: orders(id, customer_id, ordered_at, total, status). It is written in PostgreSQL syntax; date functions differ slightly in MySQL, BigQuery and SQLite, and your column names will differ from these.
SELECT DATE_TRUNC('month', ordered_at) AS month,
COUNT(*) AS orders,
SUM(total) AS revenue,
SUM(total) / NULLIF(COUNT(*), 0) AS aov
FROM orders
WHERE status NOT IN ('cancelled', 'failed')
GROUP BY 1
ORDER BY 1;Common mistakes that make Average Order Value (AOV) wrong
- Cancelled and failed orders in the data lower AOV and revenue together; filter by status.
- A few very large orders skew the mean; show the median alongside it.
- Check whether total includes shipping and tax and be consistent.
Ask for Average Order Value (AOV) in plain English
Instead of writing the query yourself, you can type the question. SchemaChat turns it into SQL against your connected database or uploaded file, runs it, and shows the SQL and the figures it used so you can check the answer before you share it. It does not replace your judgement about the definition: check that the query matches the formula your business uses.
- What was our average order value by month?
- How does AOV differ between new and returning customers?