Function Problems

Enforce Unique Rows and Columns in Excel Solver

Jason MillerJason Miller Nov 14, 2026 868 views

Question details

Model a five-person, five-workstation schedule with unique assignments in every row and column and additional ordering rules.

Enforce Unique Rows and Columns in Excel Solver
Product
Microsoft Excel Solver
Device & OS
not provided
Scenario
Five people must each visit all five workstations once, with one person at each workstation in each visit position.
Observed behavior
The desired schedule has integer workstation assignments, no repeated workstation for a person, no shared workstation at the same visit position, and any required scenario-specific rules.
Before you start

Make sure the Solver add-in is available on Excel's Data tab. Define any scheduling rules and the objective you want to optimize before building the model.

Solution 1Recommended

Build a Binary Assignment Model in Excel Solver

Use binary variables and sum constraints to enforce unique visits and workstation assignments.

This example uses five 5-by-5 blocks. Each block represents one person; its rows represent visit positions and its columns represent workstations. A value of 1 means the person visits that workstation at that position.

Every person must visit each workstation once, and each workstation must have one person at each visit position. The latter rule enforces uniqueness across people for each position.

1
Create decision cells

Reserve B2:F26 for the variables. Use rows 2–6 for person 1, rows 7–11 for person 2, and continue in five-row blocks through person 5. Label columns B–F as workstations 1–5 and the rows in each block as visit positions 1–5.

2
Calculate assignment totals

In helper cells, calculate each decision row's sum, each workstation column's sum within each person's block, and each workstation's sum across people at the same visit position. For example, use =SUM(B2:F2), =SUM(B2:B6), and =SUM(B2,B7,B12,B17,B22), respectively.

3
Add an objective

For a feasibility-only schedule, enter =SUM(B2:F26) in an objective cell and set its target to 25 in Solver. To optimize a specific linear cost instead, create a matching 25-by-5 cost table and use SUMPRODUCT on the cost table and B2:F26.

4
Set Solver constraints

Open Data > Solver. Set the objective cell and select B2:F26 as the changing variable cells. Add a binary constraint for B2:F26, then constrain every row total, every per-person workstation total, and every cross-person position-and-workstation total to equal 1.

5
Add ordering rules and solve

To require every person to start at an odd-numbered workstation, constrain the even-workstation cells C2, E2, C7, E7, C12, E12, C17, E17, C22, and E22 to 0. Add any other scenario-specific rules, choose Simplex LP for a linear model, and click Solve.

6
Read and verify the schedule

For each person's block, read the workstation number above the 1 in each visit-position row. Check the helper totals and starting positions before accepting the Solver result.

Build a Binary Assignment Model in Excel Solver
More rules need more constraints: Binary variables are integers, but they do not enforce a scheduling rule by themselves. Add a separate constraint for each additional requirement.
Free Microsoft Office alternative

Review Workstation Schedules in WPS Spreadsheets

WPS Office is a free, lightweight Office alternative with a familiar spreadsheet interface and Excel format compatibility, making it easy to migrate and review scheduling workbooks. It does not fix Excel Solver or guarantee compatibility with Solver models.

Review and edit workstation schedule tables in a familiar spreadsheet interfaceOpen and save Microsoft Excel XLSX and XLS filesMove existing spreadsheet work into a lightweight Office suiteUse WPS Office for free
microsoft office alternative - wps office

Frequently Asked Questions

Why are integer constraints alone not enough?

An integer constraint only restricts cells to whole numbers; it does not prevent repeated assignments. In the binary model, add the row, per-person workstation, and cross-person totals as constraints equal to 1 in Data > Solver.

How do I make every person start at an odd-numbered workstation?

In the example layout, add Solver constraints setting the workstation 2 and 4 cells in each person's first-visit row to 0. The row-sum constraint then assigns each person to one of workstations 1, 3, or 5.

Which Solver method should I choose?

Choose Simplex LP in Data > Solver when the objective and constraints are linear. Binary constraints can still be used with this method.

What if Solver cannot find a feasible schedule?

Review each constraint in Data > Solver, particularly the cross-person totals and any extra ordering rules. Remove or relax an additional rule temporarily to check whether it conflicts with the other requirements.