FormulaCraft

How to distribute a total evenly across rows in Excel and Google Sheets

Topic:Data cleaning & shaping
Excel & Google Sheets
=INT(A2/B2)+(ROW(A1)<=MOD(A2,B2))

Verified example

Computed by a real spreadsheet engine on the sample data below.

TotalRows
1007
Dist
=INT($A$2/$B$2)+(ROW(A1)<=MOD($A$2,$B$2))
=INT($A$2/$B$2)+(ROW(A2)<=MOD($A$2,$B$2))
=INT($A$2/$B$2)+(ROW(A3)<=MOD($A$2,$B$2))

=INT(A2/B2)+(ROW(A1)<=MOD(A2,B2))15

Try it with your data

Edit the grid or formula, then run it through a real spreadsheet engine — no signup.

Sample data — click any cell to edit

Runs server-side · free · no signup

Step by step

  1. 1Enter the total to distribute in A2 (e.g. 100) and the number of rows in B2 (e.g. 7).
  2. 2In A5 (first distribution row), enter: =INT($A$2/$B$2)+(ROW(A1)<=MOD($A$2,$B$2)). INT gives the floored base share; the second term adds 1 to the first MOD(...) rows to absorb the remainder.
  3. 3Copy A5 down by B2 rows. Each row gets either the base share or base share + 1, so the sum is exactly A2.
  4. 4Verify with =SUM(A5:A11)=$A$2 — this should return TRUE.
  5. 5For decimal amounts (e.g. currency), multiply A2 by 100 first, distribute integers, then divide results by 100 to avoid floating-point precision issues.

Tips

Working on a sheet you inherited? Run the Auditor on the whole file first — it flags every #REF!, #N/A, broken column pattern, and inconsistent formula in seconds, free, no signup.

Frequently asked

Why not just use A2/B2 directly in each row?

A2/B2 produces a repeating decimal when A2 is not evenly divisible. Summing those decimals will drift from the exact total due to floating-point representation. The INT + MOD approach guarantees the parts sum to A2.

How do I distribute to a dynamic number of rows without knowing it in advance?

Put the row count in a reference cell (like B2) and use that cell in the formula. Change B2 and copy the formula block to match — or use SEQUENCE to generate the rows dynamically.

Can I use QUOTIENT instead of INT for the base share?

Yes. QUOTIENT(A2,B2) is equivalent to INT(A2/B2) for positive integers and is slightly more readable. For negative numbers they differ, but distribution totals are usually positive.

More on Data cleaning & shaping

See all →

Formulas used

Related tasks

Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.

Last reviewed: