The Excel formulas that matter most for sales analysis are SUMIFS for revenue by product, channel or month, COUNTIFS for order counts, AVERAGEIFS for average order value, XLOOKUP for pulling prices or categories, and a PivotTable for summaries. Have Copilot draft each one from a prompt that names your columns, then check it against a hand-worked sample.
The Complete Excel Course with AI Integration
From formulas and pivot tables to Power Query, DAX, VBA and AI with Copilot, ChatGPT and Claude — hands-on from the first lesson.
By Sagnik Bhattacharya and Virginia Thorn, Primetime Emmy Award winner
Buy nowFormula syntax is rarely what goes wrong. Definitions are. Copilot cannot know that refunded jobs should not count as revenue, that your average should be per order rather than per line, or that "January" means the order date rather than the payment date, unless the prompt says so. Most errors in AI-written sales formulas are a missing condition that a ten-row sample exposes in minutes.
Which Excel formulas answer which sales questions?
Each common sales question maps to one Excel formula or tool, and naming that pairing in your prompt gets Copilot to the right answer faster. Here are the pairs most small businesses need:
| Question | Formula or tool | Pattern (simplified) |
|---|---|---|
| How much did we sell of X, in a channel, in a month? | SUMIFS | =SUMIFS(Value,Service,"Patio",Status,"Paid") |
| How many orders or jobs? | COUNTIFS | =COUNTIFS(Status,"Paid",Date,">="&H1) |
| What is the average order value? | AVERAGEIFS, or revenue divided by order count | =AVERAGEIFS(Value,Status,"Paid") if each row is one order |
| What category or price belongs to this product? | XLOOKUP | =XLOOKUP([@Product],Products[Name],Products[Category],"Not found") |
| Which customers or products appear in the data? | UNIQUE | =UNIQUE(Sales[Customer]) |
| Revenue by month and channel in one table | PivotTable, or PIVOTBY in Excel for Microsoft 365 | Ask Copilot for "a PivotTable of Value by Month and Channel" |
| Totals by one field, as a formula | GROUPBY (Excel for Microsoft 365 only) | =GROUPBY(Sales[Channel],Sales[Value],SUM) |
| Each channel's share of the total | Simple division | =H2/SUM($H$2:$H$4) |
Versions matter. XLOOKUP is not available in Excel 2016 or 2019; UNIQUE needs Excel 2021, 2024, Microsoft 365 or the web; GROUPBY is listed for Excel for Microsoft 365 only. If anyone who opens the workbook uses an older Excel, ask Copilot for SUMIFS and a PivotTable instead of the newer functions. Microsoft's own note on PIVOTBY is worth knowing: despite the name, it is not related to the PivotTable feature, though it produces similar summaries.
How should sales data be laid out before Copilot writes formulas?
Sales data should sit in one Excel table with one row per order or job line, real dates, numbers stored as numbers and a status column. Every formula and Copilot prompt depends on clean, consistently named columns, and twenty minutes here saves hours of puzzling over wrong totals.
- Put the data on its own sheet and convert it to a table: select any cell and press Ctrl+T. Name it something short, such as Sales.
- Use one header row with plain names: Date, Customer, Service, Channel, Status, Value. Copilot's own tip is that naming the columns you want analysed produces more accurate results, and short names make prompts easier to write.
- Make sure dates are real dates and values are numbers. Select a few cells: the status bar shows a sum and average only for numbers, so if it shows just a count, the values are stored as text.
- Add a Status column (Paid, Refunded, Cancelled) rather than deleting refunded rows. Deleted rows cannot be analysed later; a status can be filtered.
- Remove subtotal or total rows from inside the data. A "January total" row in the middle of the table gets counted twice by every SUMIFS.
- Save the file to OneDrive or SharePoint and leave calculation on Automatic, which Copilot needs before it can edit the workbook.
If your sales arrive as a messy monthly export from a till or booking system, tidy it first: cleaning a monthly sales export walks through the usual problems, and merging two Excel files with Copilot covers combining a sales list with a product or customer list.
How do you prompt Copilot to write a sales formula?
A sales formula prompt works when it states the measure, every condition, where the result goes, and which input cells hold dates or rates. Open the Copilot pane from the icon in the lower-right corner of Excel and write the prompt as if briefing a new bookkeeper.
In the Summary sheet, cell C4, write a formula for paid revenue from
the Sales table: sum Sales[Value] where Sales[Status] is "Paid" and
Sales[Date] is on or after the date in C1 and on or before the date in C2.
Use SUMIFS. Do not type any dates into the formula; reference C1 and C2.
Then explain the formula in one sentence.
An illustrative first answer came back as =SUMIFS(Sales[Value],Sales[Date],">="&C1,Sales[Date],"<="&C2) with the explanation "Adds the values of all sales between the two dates." The explanation is accurate, and that is the problem: the Status condition is missing, so refunded and cancelled jobs count as revenue. The fixed version adds Sales[Status],"Paid" as a further pair. SUMIFS takes up to 127 range and criteria pairs, so conditions are cheap; leaving one out is what costs you.
Three more prompts worth keeping, each with the trap to check:
- "Add a column to the Sales table that looks up each service's category from the Services table with XLOOKUP, returning 'Not found' if missing." Check: filter the new column for "Not found"; every hit is a spelling difference between the two tables.
- "In the Summary sheet, show paid revenue by channel as a PivotTable." Check: the PivotTable's grand total must equal your paid-revenue cell. If it is higher, the Status filter was not applied.
- "Add a column that shows each channel's percentage of total paid revenue." Check: the percentages should add to 100%. Microsoft lists a near-identical prompt ("each region's percentage of total sales") among its examples.
A landscaping company's quarter, checked against a 12-row sample
To see the method end to end, take an illustrative landscaping company that wants its first-quarter figures. Before letting Copilot loose on 900 rows, the owner copies a 12-row sample into a test sheet, including the awkward cases, and works out the answers by hand.
| Date | Service | Channel | Status | Value ($) |
|---|---|---|---|---|
| 3 Jan | Patio | Website | Paid | 2,400 |
| 7 Jan | Planting | Referral | Paid | 650 |
| 12 Jan | Lawn care | Repeat | Paid | 120 |
| 19 Jan | Patio | Referral | Refunded | 1,800 |
| 28 Jan | Planting | Website | Paid | 900 |
| 2 Feb | Lawn care | Repeat | Paid | 120 |
| 10 Feb | Patio | Website | Paid | 3,100 |
| 15 Feb | Design | Referral | Paid | 450 |
| 21 Feb | Planting | Website | Cancelled | 700 |
| 2 Mar | Lawn care | Repeat | Paid | 120 |
| 9 Mar | Patio | Referral | Paid | 2,750 |
| 25 Mar | Planting | Website | Paid | 1,050 |
The hand-worked answers: paid revenue is $11,660 across 10 paid jobs ($14,160 if refunded and cancelled jobs are wrongly included). By month, January is $4,070, February $3,670 and March $3,920, which add back to $11,660. Paid patio revenue is $8,250. By channel, Website brings $7,450 (63.9%), Referral $3,850 (33.0%) and Repeat $360 (3.1%). The average paid job is $11,660 ÷ 10 = $1,166.
| Measure | Hand answer | Copilot's first formula gave | Cause | Fixed? |
|---|---|---|---|---|
| Paid revenue | $11,660 | $14,160 | No Status condition | Added Status = "Paid" |
| Paid patio revenue | $8,250 | $8,250 | None | Already right |
| January paid revenue | $4,070 | $5,870 | Same missing condition, plus the refunded patio job | Added Status |
| Paid job count | 10 | 10 | None | Already right |
| Average paid job | $1,166 | $1,180 | AVERAGE over all 12 rows | Switched to AVERAGEIFS with Status |
| Channel shares | 63.9 / 33.0 / 3.1% | Added to 100% | Correct once revenue was fixed | Rechecked |
The results are illustrative, but the pattern is typical: the formulas that need one condition were right, and the ones that needed a business definition (what counts as revenue) were wrong in the same way. Note how small the average-job error looks: $1,180 against $1,166 is just over 1%, and nobody would spot it on the full data. On the sample, with the answer written down beforehand, it is obvious. With the formulas fixed on the sample, the owner points them at the full table, and the reconciliation checks below confirm the totals hold.
If you want help fitting sales reporting in Excel into how your business runs, I offer one-to-one AI consultations for small businesses.
Comparing one month with the last
Month-on-month growth is a one-line formula, and the sample makes it easy to check. With February's paid revenue in one cell and January's in another, growth is February minus January, divided by January: ($3,670 − $4,070) ÷ $4,070 = −9.8%. March against February is ($3,920 − $3,670) ÷ $3,670 = +6.8%. Two details are worth putting in the prompt. Ask Copilot to keep the start and end dates of each month in their own cells, so next quarter only the dates change. And ask for a growth formula that shows a blank or a short message when the earlier month is zero, because dividing by a month with no sales returns #DIV/0!, which IFERROR can turn into "No sales last month".
A second example: a tutoring centre's enrolments by course
The same method works for counts as well as money. An illustrative tutoring centre keeps one row per enrolment with Date, Student, Course, Type (New or Returning) and Fee. The owner wants new enrolments per course in September and the fee income they bring. Six sample rows are enough to test the logic:
| Date | Student | Course | Type | Fee ($) |
|---|---|---|---|---|
| 2 Sep | Student A | Maths | New | 320 |
| 4 Sep | Student B | Maths | Returning | 320 |
| 9 Sep | Student C | English | New | 280 |
| 15 Sep | Student D | Maths | New | 320 |
| 22 Sep | Student E | Sciences | Returning | 350 |
| 3 Oct | Student F | Maths | New | 320 |
By hand, September has two new Maths enrolments (A and D) worth $640, and one new English enrolment worth $280; Student F is October and must not count. Copilot's illustrative first COUNTIFS for "new Maths enrolments in September" returned 3, because it filtered on Course and Type but forgot the date range, so the October row slipped in. Adding the two date conditions brought it to 2. Its SUMIFS for the fee was right first time, because the prompt for that one happened to mention September explicitly. The lesson is the same as with the landscaping data: every condition you have in your head must be written in the prompt, and the sample must contain a row that tests each one, here a row from the wrong month.
A prompt library worth saving
Once a prompt has produced a formula that passed the sample, save the wording. These are the ones most owners reuse, with the check that goes with each:
| Prompt (shortened) | Copilot should produce | Check against the sample |
|---|---|---|
| Paid revenue between the dates in C1 and C2 | SUMIFS with Status and two date conditions | Matches the hand total; refunded rows excluded |
| Paid jobs between the same dates | COUNTIFS with the same three conditions | Matches the hand count |
| Average paid order value | Revenue divided by order count, or AVERAGEIFS if one row per order | Matches revenue ÷ count from the sample |
| Category for each product from the Products table | XLOOKUP with an if-not-found message | No "Not found" rows, or each explained |
| Revenue by channel as a PivotTable | PivotTable filtered to Paid | Grand total equals paid revenue |
| Growth on the previous month | Difference divided by last month, error-safe | Matches the hand percentage |
Keep the library on a sheet in the workbook itself. When a colleague asks for "sales by channel for last quarter", they start from wording that already handles refunds and dates, instead of a fresh prompt that may not.
How do you check Copilot's sales formulas on the full data?
Copilot's sales formulas are checked on the full data with reconciliations: totals split different ways must add back to the same grand total, and each formula's inputs must trace to the right columns. Run these after the sample test passes.
- Split-and-add. Revenue by month, by channel and by service should each add up to the same paid-revenue total. If one split falls short, rows are missing a month, channel or service value.
- Status count. COUNTIFS for Paid plus Refunded plus Cancelled should equal the number of rows. A shortfall means a status spelt differently somewhere ("paid", "Paid ").
- Status bar spot check. Filter the table to one service and status, select the Value cells, and read the sum in the status bar. It should equal the formula's answer for that pair.
- Show formulas. Press Ctrl + ` to show formulas and confirm summary cells reference the table columns, not fixed ranges such as A2:A900 that will miss next month's rows.
- Trace and evaluate. For any surprising figure, select it and use Formulas, Trace Precedents to see where it draws from, then Evaluate Formula to step through it one part at a time.
- Ask for an explanation, then compare. In Chat only mode, ask Copilot to "explain the formula in cell C4". If the explanation leaves out a condition you expect, the formula leaves it out too.
If building these reconciliation checks is the slow part, try The Complete Excel Course with AI Integration on Coding Liquids.
When should you use a PivotTable instead of formulas?
A PivotTable is the better choice for exploring sales from several angles quickly; formulas are better for a fixed summary sheet whose cells you reference elsewhere, such as a monthly report or a dashboard. Copilot can produce either, so choose by how the numbers will be used.
| Need | Best tool | Why |
|---|---|---|
| "Show me revenue by every combination" exploration | PivotTable | Drag fields around without writing formulas |
| A monthly report with fixed cells | SUMIFS and COUNTIFS | Each number sits in a known cell other sheets can use |
| A summary that grows with the data, as a formula | GROUPBY or PIVOTBY (Microsoft 365) | Spills a summary table that updates with the source |
| A dashboard for others | Formulas feeding charts | Stable layout; see the dashboard tutorial linked below |
| Sharing with someone on Excel 2019 | SUMIFS or a PivotTable | Newer functions won't calculate in older versions |
Whatever you choose, ask Copilot by format: Microsoft's guidance is to name the format, such as a PivotTable, in the prompt. When Copilot builds a summary for a dashboard, the errors to expect are covered in what Copilot gets wrong in a sales dashboard.
Which errors show up in Copilot-written sales formulas?
The errors in Copilot-written sales formulas are mostly missing conditions, text that looks like numbers or dates, ranges that do not line up, and averages taken at the wrong level. Each has a recognisable symptom.
| Symptom | Likely cause | Fix |
|---|---|---|
| Revenue higher than the bank shows | Refunds or cancellations counted | Add a Status condition |
| SUMIFS returns 0 | Dates or values stored as text, or a criterion spelt differently | Convert to real dates and numbers; tidy spellings |
| #VALUE! from COUNTIFS or AVERAGEIFS | Criteria ranges of different sizes | Microsoft requires matching sizes; use table columns |
| #DIV/0! from AVERAGEIFS | No rows meet the criteria | Expected for an empty month; wrap with IFERROR to show a message |
| #N/A from XLOOKUP | Product not found in the lookup table | Use the if-not-found argument and fix the spelling |
| Average order value too low | Each row is a line item, not an order | Divide revenue by COUNT of unique order IDs |
| Next month's sales missing | Formula uses fixed ranges like A2:A900 | Reference table columns, which grow with the data |
| Date range off by a day | "<" used where "<=" was meant | Check boundary dates in the sample |
The average-order-value trap deserves a closer look because it is easy to miss. If an order for patio slabs, sub-base and labour is three rows, AVERAGEIFS on Value averages lines, not orders, and understates the true order value. Count orders with =ROWS(UNIQUE(FILTER(Sales[Order ID],Sales[Status]="Paid"))) in Excel 2021 or later and divide paid revenue by that count.
How do you get insights from Copilot, not just formulas?
Copilot gives sales insights when you ask a business question about named columns and say how you want the answer shown. Microsoft's own examples include "Which region had the highest and lowest sales?" and "Are there any outliers or anomalies in this data?", and Copilot can answer with charts, PivotTables, summaries, trends or outliers.
Questions that tend to be useful for a small business:
- "Using the Sales table, which three services grew most between January and March in paid revenue? Show a small table."
- "Are there any customers whose paid spend dropped by more than half compared with the previous quarter?"
- "Show paid revenue by channel by month as a PivotTable and a line chart."
- "List any paid jobs with a value more than three times the average for that service."
Here is what that looks like on the landscaping sample. Asked "Using the Sales table, which channel's paid revenue grew most from January to March?", an illustrative answer read: "Referral grew the most, from $650 in January to $2,750 in March, an increase of $2,100. Website fell from $3,300 to $1,050, and Repeat stayed at $120." Every figure in that answer can be checked against the hand-worked table in under a minute: January referral is $650 only because the refunded $1,800 patio job is excluded, and January website is $2,400 plus $900. Had Copilot quoted January referral as $2,450, you would know at once that the refund had crept back in, and that any formula built on the same reading needs the Status condition too.
Treat insights like formulas: each one rests on a calculation you can see and check. If Copilot says Referral revenue grew 40%, ask it to show the two figures it compared, then confirm one of them against your sample or a filtered status-bar sum. On a commercial Copilot licence or Microsoft 365 Premium, Copilot in Excel also lets you switch between Claude and GPT models, or leave it on Auto; trying the same question on a second model is a cheap way to spot an answer that depends on a misreading. For broader analysis ideas, see Copilot for data analysis.
What does a reusable sales check sheet look like?
A reusable sales check sheet holds your hand-worked sample answers next to the live formulas, so every time Copilot changes a formula you can see whether the sample still gives the right numbers. Build it once, keep it in the workbook, and rerun it monthly.
| Check | Expected (sample) | Formula result | Pass? |
|---|---|---|---|
| Paid revenue, quarter | 11,660 | 11,660 | =IF(C2=B2,"PASS","CHECK") |
| Paid revenue, January | 4,070 | 4,070 | PASS |
| Paid jobs | 10 | 10 | PASS |
| Average paid job | 1,166 | 1,166 | PASS |
| Channel shares add to 100% | 100% | 100% | PASS |
| Month split adds to quarter | 11,660 | 11,660 | PASS |
Point the formula-result column at a copy of your summary formulas that reads the sample sheet instead of the full table. A row turning to "CHECK" after an edit tells you which definition has drifted before the wrong number reaches a report. If the workbook came from someone else and you need to understand its formulas before trusting them, explaining an inherited formula with Copilot covers that audit, and the licence you need for any of this is set out in Copilot in Excel pricing.
Sales formulas and Copilot: follow-up questions
Which Excel formula is best for sales by month?
SUMIFS with a date range is the most flexible: sum the Value column where the date is on or after the first of the month and on or before the last, plus any status condition. For a quick table of every month at once, ask Copilot for a PivotTable grouped by month, or use GROUPBY if you have Excel for Microsoft 365.
Can Copilot in Excel make a PivotTable from my sales data?
Yes. Microsoft says Copilot in Excel can create and edit PivotTables with editable links to the source data, and that you should name the format in your prompt, for example 'show revenue by channel and month as a PivotTable'. Check the PivotTable's grand total against a SUM of the Value column before using it.
Why does my SUMIFS return zero?
Usually because the criteria never match. Dates or numbers stored as text, product names with trailing spaces, a status spelt differently ('paid' versus 'Paid ') or criteria ranges pointing at the wrong column all produce zero. Test one criterion at a time, and check a suspect cell's format with the number shown in the status bar.
Is XLOOKUP better than VLOOKUP for sales data?
Yes, where it is available. XLOOKUP matches exactly by default, can return columns to the left of the lookup column, and has an if-not-found argument for a clear message instead of #N/A. It is not available in Excel 2016 or 2019, so anyone on those versions sees broken cells in a workbook that relies on it.
How many rows should I check by hand?
Ten to twenty rows are enough if they cover every category, every status (paid, refunded, cancelled), at least two months and one awkward case such as a zero-value line. Work out the expected answers on paper or with a calculator, then compare each Copilot formula's result with your figure before trusting it on the full data.
Further reads
- How to Create a Sales Dashboard in Excel Using ChatGPT — Turn these sales formulas into a one-page dashboard.
- Power BI vs Excel With Copilot for Small Business Dashboards — Decide when sales reporting outgrows Excel.
- How to Use ChatGPT for Accounting in Excel and Check the Results — More checking routines for AI-written spreadsheet work.
- Can Copilot in Excel Build a Quote, Invoice or Stock Sheet? — Have Copilot build the quote and invoice sheets sales come from.
- How to Clean a Customer List in Excel With Copilot — Fix duplicate customers before you count them.
- ChatGPT for Excel Not Working or Not Showing? How to Fix It — A fix checklist for the ChatGPT add-in for Excel: install route, account and plan, admin switches, the sign-in error, unsupported features and big workbooks.
Browse all AI-for-business tutorials
Sources: Microsoft Support pages for SUMIFS, COUNTIFS, AVERAGEIFS, XLOOKUP, UNIQUE, GROUPBY, PIVOTBY and IFERROR; Get data insights with Copilot in Excel; Get started with Copilot in Excel; Copilot in Excel FAQ; Evaluate a nested formula; Display the relationships between formulas and cells; Display or hide formulas; View summary data on the status bar. Read 23 November 2026.
