Filling In An M by N Matrix Based On Row And Column Constraints

acemanhattan

New Member
Joined
May 11, 2016
Messages
45
Here's the scenario: You have 1,2,3,...N tasks to do sequentially, all which take a range of time to complete (column constraint), but you're only allowed to set aside a certain amount of time on each of M days (row constraint) to complete these tasks.

Example: You have a 5 chapter book to read, but you can only set enough time aside to read 12 pages a day during the week and, oddly, 6 pages a day during the weekend.

In our example the matrix acts as a "schedule" that shows how many pages of each chapter you'll read on a given day, and projects when you'll finish reading the book.

I envision a matrix that looks something like the following

[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD][/TD]
[TD]Chapter 1[/TD]
[TD]Chapter 2[/TD]
[TD]Chapter 3[/TD]
[TD]Chapter 4[/TD]
[TD]Chapter 5[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]9[/TD]
[TD]11[/TD]
[TD]29[/TD]
[TD]8[/TD]
[TD]14[/TD]
[/TR]
[TR]
[TD]Day 1[/TD]
[TD]12[/TD]
[TD]9[/TD]
[TD]3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Day 2[/TD]
[TD]12[/TD]
[TD][/TD]
[TD]8[/TD]
[TD]4[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Day 3[/TD]
[TD]12[/TD]
[TD][/TD]
[TD][/TD]
[TD]12[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Day 4[/TD]
[TD]12[/TD]
[TD][/TD]
[TD][/TD]
[TD]12[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Day 5[/TD]
[TD]12[/TD]
[TD][/TD]
[TD][/TD]
[TD]1[/TD]
[TD]7[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]Day 6[/TD]
[TD]6[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]6[/TD]
[/TR]
[TR]
[TD]Day 7[/TD]
[TD]6[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]4[/TD]
[/TR]
</tbody>[/TABLE]

I spent a few hours yesterday trying to do this with a combination of if(sum()) type statements, but couldn't figure out anything the would work, so I appreciate any solutions you might have (though I prefer Non VBA solutions).
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
This formula should work for you. The 0's can be removed via conditional formatting, or by a very ugly IF formula.
Note that the blank row and column are needed, but can be hidden if desired.


Unknown
ABCDEFGH
1Chapter 1Chapter 2Chapter 3Chapter 4Chapter 5
291129814
3
4Day 11293000
5Day 21208400
6Day 312001200
7Day 412001200
8Day 51200183
9Day 6600006
10Day 7600005
Sheet1
Cell Formulas
RangeFormula
D4=MIN(D$2-SUM(D$3:D3),$B4-SUM($C4:C4))
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top