Most point-of-sale systems and online marketplaces export sales as line items: one row per product on a bill, with the date, bill number, product code, quantity and price. The owner, though, wants the big picture: which products sold most this month, which ones made money, and how it compares with last month.
This post shows three ways to turn a line-item file into a monthly sales summary by product, from Excel formulas to drag-and-drop with no formulas.
What you need
- A sales file: date, bill number, product code, quantity, unit price (or line amount).
- A product list (for names, categories and profit): product code, name, category, unit cost.
- Product codes written the same way in both files, for example not "00123" on one side and "123" on the other.
Way 1: SUMIFS
Build a summary table with product codes as rows and months as columns, and use SUMIFS to add up the amount by product code and the date range of each month. Pull product names and costs from the product list with XLOOKUP or VLOOKUP.
=SUMIFS(Sales[Amount], Sales[ProductCode], $A2,
Sales[Date], ">="&C$1, Sales[Date], "<"&EDATE(C$1,1))- Pros: full control over the layout, anyone opening the file can see the formulas.
- Cons: new products need new rows by hand, thousands of formulas slow the file down, and one mis-dragged formula gives a wrong total with no warning.
Way 2: PivotTable
Select the sales table, insert a PivotTable, put the product code in Rows and the date in Columns grouped by month (Group > Months and Years), and the amount in Values. For product names or costs, add XLOOKUP columns to the sales table first, or use the Data Model to relate the two tables.
- Pros: fast, change the view by dragging fields, no formulas for the totals.
- Cons: you must Refresh, and extend the source range when it is not an Excel Table, each time new data arrives; profit inside a Pivot needs a Calculated Field that many people do not know.
Way 3: drag and drop on the Join Canvas
In Ruamhub the same steps are boxes on a canvas. No database is needed: use the .xlsx or CSV files you exported.
- Upload the sales file and the product list.
- Add a Join box on the product code. Choose a left join so sales lines with no matching product are not dropped.
- Add a Formula box for a month column, such as STRFTIME([sale_date], '%Y-%m'), and a profit column, [qty] * ([price] - [cost]).
- Add a Group by box on month and product with SUM of quantity and amount, SUM of profit, and COUNT DISTINCT of bill number.
- Preview the result, then export it as Excel or a PDF report.
For only the top 10 products each month, add another Formula box after Group by to rank them, then a Filter box that keeps ranks 1 to 10.
RANK() OVER (PARTITION BY [month] ORDER BY [total_amount] DESC)- Pros: no formulas to drag, new products appear by themselves because the summary groups the real data, every step is visible, and teammates can run it.
- Cons: the files have to be uploaded, the table layout is less flexible than in Excel, and the Free plan has 1 pipeline and 30 runs a month.
Mistakes that make the summary wrong
- Cancelled bills and returns: many systems export them as negative rows or with a status column. Decide whether to filter them out or keep them to net off the sales.
- Bill-level discounts: if the discount sits on the bill, not on each product, the product totals add up to more than the money you received.
- With or without VAT: cost and selling price must be on the same basis before you compute profit.
- Counting bills with plain COUNT: a bill with five products is counted five times. Use COUNT DISTINCT of the bill number.
- Products missing from the product list: an inner join drops these lines silently. Use a left join and filter for rows with an empty product name.
Which one to pick
- A few dozen products and you want your own layout: SUMIFS.
- Many views quickly and you are at home in Excel: PivotTable.
- Every month, run by anyone on the team, with profit and best sellers and no formulas to drag: the Join Canvas.
Sales files from several branches? Read how to combine them first →