Guide

How to combine partial fills in Excel

How to turn several fills of one order into one quantity, one gross amount and one average price, with formulas that work on a Statementizer Trades sheet.

Short answer

To combine partial fills in Excel, total the quantity and the gross amount of the fills for one symbol and side with SUMIFS, then divide the gross by the quantity for the average price. Three fills of 100 at 10.00, 50 at 10.30 and 50 at 10.10 combine to 200 shares at an average of 10.10.

The idea

A statement can list one order as several rows, each with its own quantity and price. The combined figures are sums: total quantity, total gross, total fees. The average price is the total gross divided by the total quantity. Gross is quantity times price on each row, so the average weights each fill by its size.

A worked example

Three invented fills of one buy order
DateSymbolSideQuantityPriceGrossFees
2026-03-02AAABuy10010.001000.001.00
2026-03-02AAABuy5010.30515.001.00
2026-03-02AAABuy5010.10505.001.00

Totals: 200 shares, gross 2020.00, fees 3.00. Average price = 2020.00 ÷ 200 = 10.10. With the fees included, the cost per share is (2020.00 + 3.00) ÷ 200; the stock average calculator computes that from the fills.

The formulas

Microsoft gives the syntax SUMIFS(sum_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...). On a Trades sheet with columns A to H in the order Date, Symbol, Side, Quantity, Price, Gross, Fees, Net, the three totals for symbol AAA bought are:

=SUMIFS(D:D, B:B, "AAA", C:C, "Buy")=SUMIFS(F:F, B:B, "AAA", C:C, "Buy")=SUMIFS(G:G, B:B, "AAA", C:C, "Buy")
Totals for one symbol and side

The first line totals quantity, the second gross and the third fees. Divide the second result by the first for the average price. Write the Side text exactly as it appears in column C of your sheet. The journal template's By symbol sheet uses the same SUMIFS pattern to total quantities, fees and cash per symbol.

Caveats

  • Combine buys with buys and sells with sells. Mixing sides in one sum gives a figure that means nothing.
  • SUMIFS adds every row that matches, including rows from different days. Add the date column as another criteria range and criteria pair, in the syntax above, to limit the sum to one day.
  • If the Quantity or Gross column holds numbers stored as text, the sums come out wrong. See the numbers stored as text guide.
  • Whether two rows are fills of the same order is a judgement the spreadsheet cannot make. Statementizer reads the rows as the statement prints them.

Common questions

Why not average the prices directly?
A plain average of 10.00, 10.30 and 10.10 is 10.13, because it gives a 100-share fill the same weight as a 50-share fill. Dividing total gross by total quantity weights each fill by its size.
Do fees belong in the average price?
That depends on what the figure is for. The gross-based average leaves fees out; adding fees to the gross gives a cost per share that includes them.
Which Excel versions have SUMIFS?
Microsoft lists SUMIFS for Excel 2016 and later versions.
Can a pivot do this?
For the totals, yes: Sum of Quantity and Sum of Gross by Symbol and Side. The average price is then one division. See the pivot table guide.

What Statementizer does with this

Statementizer reads supported broker statement PDFs into rows you can review, and exports them to Excel or CSV. The Trades sheet of the Excel export has the columns Date, Symbol, Side, Quantity, Price, Gross, Fees, Net, Currency, Confidence and Review Status, so the formulas above work on it as they are.

See what Statementizer converts

Sources

The SUMIFS syntax is from Microsoft's SUMIFS function page, read on 2026-11-12 (no updated date shown). The example fills are invented and every total is computed from them. Gross as quantity times price is the rule Statementizer's row check uses.

Verified on 2026-11-12 by the Statementizer Team.