Excel Formula to Divide a Number into Sequential Sections
Question details
The user needs to divide a total quantity into sequential numerical text ranges across a specified number of sections or cells.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Organizing a total quantity (such as 23 pallets) into evenly distributed sequential text ranges across multiple columns.
- Observed behavior
- The goal is to input a total number and a target number of sections, then output sequential text ranges (e.g., '1-6', '7-12') into adjacent columns.
Ensure you have designated specific cells in your worksheet for your total number and the number of sections to reference in your formula.
Use a Combined IF, COLUMN, and CEILING Formula
This formula dynamically calculates the start and end of each sequence range and formats it into sequential text strings across your columns.
This method uses the CEILING function to determine the size of each section based on the total. It then uses the COLUMN function to increment the numbers appropriately as you drag the formula across multiple columns.
Enter your total number in a specific cell (e.g., cell O2). Next, enter the number of sections you want to divide the total into in another cell (e.g., cell P2).
Select the first output cell where you want the first range to appear. Type the formula: =IF(COLUMN(A2)>$P2,"",(COLUMN(A2)-1)*CEILING($O2/$P2,1)+1&"-"&IF(COLUMN(A2)=$P2,$O2,COLUMN(A2)*CEILING($O2/$P2,1))) and press Enter.
Click and drag the fill handle (the small square at the bottom-right of the cell) across the adjacent columns to generate the remaining sequential ranges.

Use a VBA Macro for Range Partitioning
If you prefer not to use complex formulas, a VBA macro can automatically divide and distribute the value among a specified range of cells.
Create Advanced Formulas Easily in WPS Spreadsheet
WPS Spreadsheet provides full support for complex mathematical and logical functions, allowing you to easily calculate and divide numbers into sequential ranges. It offers comprehensive compatibility with Microsoft Excel formulas.
- 1. Open Your Document: Launch WPS Spreadsheet and open the workbook where you need to partition your data.
- 2. Input Your Variables: Enter your total value and the number of target sections into two separate reference cells.
- 3. Apply the Formula: Paste the combined IF and CEILING formula into your first target cell, adjust your cell references, and press Enter.
- 4. Drag to Auto-fill: Drag the fill handle horizontally across the columns to instantly generate all sequential sections.

Frequently Asked Questions
Why does my formula return a #NAME? error?
This error usually occurs if there is a typo in the function names (such as typing 'CELING' instead of 'CEILING'). Double-check the spelling of all functions in your formula bar.
Can I divide the sequential ranges vertically into rows instead of columns?
Yes. To divide sequential ranges vertically down rows, you will need to replace the COLUMN() function with the ROW() function in the formula.
What happens if the total number does not divide evenly?
The CEILING function automatically rounds the division up to the nearest integer. The final section will be formulated to end exactly at the original total number specified in your reference cell.




