Excel guide · 5 min read
How to calculate days sales outstanding (DSO) in Excel
=SUMIFS(D2:D15,E2:E15,"Credit",F2:F15,"")/SUMIFS(D2:D15,E2:E15,"Credit",C2:C15,">="&J2,C2:C15,"<="&J3)*(J3-J2+1). Here $19,770 unpaid / $29,600 of credit sales x 92 days is about 61 days.Sample data
Every result on this page was calculated from this sheet by the same spreadsheet engine the Cellwise app uses.
| A | B | C | D | E | F | G | H | I | J | |
|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Invoice | Customer | Date | Amount | Type | Paid on | Age (days) | Setting | Value | |
| 2 | INV-101 | Brightway | Aug 4, 2026 | 2400 | Credit | Sep 2, 2026 | Period start | Aug 1, 2026 | ||
| 3 | INV-102 | Counter sale | Aug 9, 2026 | 380 | Cash | Aug 9, 2026 | Period end | Oct 31, 2026 | ||
| 4 | INV-103 | Hale & Co | Aug 18, 2026 | 1650 | Credit | Sep 30, 2026 | Month start | Oct 1, 2026 | ||
| 5 | INV-104 | Northfield | Aug 27, 2026 | 3100 | Credit | 65 | ||||
| 6 | INV-105 | Brightway | Sep 3, 2026 | 2200 | Credit | Oct 1, 2026 | ||||
| 7 | INV-106 | Counter sale | Sep 12, 2026 | 450 | Cash | Sep 12, 2026 | ||||
| 8 | INV-107 | Pike Studio | Sep 16, 2026 | 980 | Credit | Oct 20, 2026 | ||||
| 9 | INV-108 | Hale & Co | Sep 24, 2026 | 1750 | Credit | 37 | ||||
| 10 | INV-109 | Brightway | Oct 2, 2026 | 2600 | Credit | Oct 29, 2026 | ||||
| 11 | INV-110 | Counter sale | Oct 8, 2026 | 520 | Cash | Oct 8, 2026 | ||||
| 12 | INV-111 | Pike Studio | Oct 14, 2026 | 1120 | Credit | 17 | ||||
| 13 | INV-112 | Northfield | Oct 21, 2026 | 2900 | Credit | 10 | ||||
| 14 | INV-113 | Hale & Co | Oct 27, 2026 | 1400 | Credit | 4 | ||||
| 15 | INV-114 | Orion Group | Oct 30, 2026 | 9500 | Credit | 1 |
Download this sheet as an Excel practice file (.xlsx)
Step 1: Credit sales for the period
Keep one row per invoice with the date, the amount, whether it was a credit sale (you sent an invoice to pay later) or a cash sale (paid on the spot), and the date it was paid. Leave Paid on blank while it's open.
Only credit sales belong in DSO. A counter sale paid in cash never becomes a receivable, so counting it makes collection look faster than it is. With the period dates in J2 and J3, SUMIFS adds the credit invoices dated August 1 to October 31: $29,600. The three cash sales ($1,350) stay out.
Result: 29600 shows as $29,600 with Currency format
29600: credit sales from August 1 to October 31.
Step 2: Receivables at period end, then DSO
Accounts receivable (AR) is what customers still owe. Here it's the credit invoices with no paid date: $19,770. Days in the period is J3-J2+1 = 92, because subtracting dates leaves out the first day. Some teams use a fixed 30, 90 or 365 instead. Either works if you never switch.
DSO is $19,770 / $29,600 x 92, about 61.4 days. Put cash sales in by mistake and it drops to 58.8, a nicer number that's wrong.
Run the export after the period ends and some invoices may be paid by then. They were still owed on October 31, so count them too: add SUMIFS(D2:D15,E2:E15,"Credit",C2:C15,"<="&J3,F2:F15,">"&J3) to the open total. If customers pay in parts, use a Balance column instead of Amount, so AR is the amount still owed and not the original invoice.
Result: 61.447297297
About 61.45: on average it takes about 61 days of sales to collect what's owed.
Monthly DSO, and why it doesn't match the quarter
For October alone, divide the same AR by October's credit sales ($17,520) and multiply by the days in October. DAY(EOMONTH(J4,0)) returns 31 from the month start in J4. The result is about 35 days.
That's not a mistake, and it's the most confusing thing about DSO. The formula compares what's owed with average daily sales. Over the quarter that's $321.74 a day; in October alone it's $565.16 a day, because October was a big month. Same receivables, bigger daily sales, lower DSO.
So pick one period length for your trend and keep it. A common choice is to recalculate every month on the last 90 days of sales. Comparing a monthly DSO with a quarterly one tells you nothing.
Result: 34.981164384
About 34.98: October's DSO on October's sales.
One big invoice can move DSO more than late payers
Orion Group's $9,500 invoice is dated October 30, one day before the period ends. Nobody is late on it, yet it's almost half of AR. Take it out of both the receivables and the sales and quarterly DSO falls from 61.4 to about 47 days.
A big invoice near period end pushes DSO up, and one paid early pushes it down, without any change in how fast customers pay. When DSO jumps, check the biggest open invoices before chasing anyone. The aging table below shows where the money actually sits.
Result: 47.006965174
About 47.01: quarterly DSO without the $9,500 invoice from October 30.
The countback method
Countback asks how many recent days of sales add up to the money you're owed. Work backward from the latest month until AR is used up. It reacts less to a single big month than the average method.
Here: AR is $19,770. October's credit sales were $17,520, so all 31 October days count and $2,250 is left. September's credit sales were $4,930, so the rest covers 2,250 / 4,930 x 30 = 13.7 days. Countback DSO is 31 + 13.7, about 44.7 days.
- Start with AR at period end.
- Take the latest month's credit sales. If AR is larger, count every day of that month and subtract that month's sales from AR.
- Repeat with the month before until the remaining AR is smaller than a month's sales.
- For that last month, count (remaining AR / that month's sales) x days in that month, and add it.
Result: 44.69168357
About 44.69: 31 days of October plus 13.7 days of September.
AR aging buckets with SUMIFS
Add an Age column: =IF(F2="",$J$3-C2,"") gives days since the invoice date for open invoices and stays blank for paid ones. SUMIFS with two conditions on the same column fills each bucket: "<=30", then ">30" and "<=60", then ">60" and "<=90", then ">90".
Here $14,920 is 30 days old or less, $1,750 is 31 to 60 days and $3,100 (Northfield's August invoice, 65 days) is 61 to 90. That's 24.5% of AR older than 30 days. DSO says "about two months"; aging tells you which customer to call. Swap SUMIFS for COUNTIFS to count invoices per bucket.
Result: 1750
1750: open invoices aged 31 to 60 days.
Common mistakes
Counting cash sales
Only invoices paid later create receivables. Filter sales to credit sales with SUMIFS, or DSO comes out too low.
Mixing period lengths
Monthly and quarterly DSO use different daily sales, so they don't match. Pick one (often the last 90 days) and use it every month.
Using the original invoice amount after part payments
AR is what's still owed. Keep a Balance column and sum that instead of Amount.
Reading DSO without the aging table
One big recent invoice can raise DSO with nobody late. Check the 31-60, 61-90 and 90+ buckets before chasing customers.
FAQ
What is the DSO formula in Excel?
=receivables/credit_sales*days. With SUMIFS: open credit invoices / credit sales dated in the period x (end date - start date + 1).
What is a good DSO?
Compare it with your payment terms. If you give customers 30 days and DSO is around 30 to 40, they mostly pay on time. A DSO far above your terms means a lot of money is coming in late.
How is DSO different from average days to pay?
DSO compares what's owed with sales. Average days to pay looks at paid invoices only: =AVERAGE(IF((E2:E15="Credit")*(F2:F15<>""),F2:F15-C2:C15)) gives 32.2 days here. The two answer different questions, and big open invoices only show up in DSO.
How do I calculate annual DSO?
Use AR at year end, credit sales for the whole year and 365 days. Because a year smooths out big months, annual DSO moves slowly; use a monthly 90-day DSO to spot changes early.
Functions used
SUMIFSAdds with several conditionsCOUNTIFSCounts with several conditionsDAYDay of the monthEOMONTHLast day of a monthIFPicks a result from a testAVERAGEMean of numbers
Related guides
- How to calculate due dates and days overdue in Excel
- SUMIFS between two dates in Excel
- How to calculate days between two dates in Excel
- How to find the last day of the month in Excel
- How to calculate cash runway in Excel
- How to calculate MRR (monthly recurring revenue) in Excel
- How to calculate year-over-year growth in Excel
Updated