Calculating the size of uniform cabinet doors on two walls I know using this board for this problem is overkill, but I'm struggling with something that I know should be simple.
I'm building kitchen cabinets on two different walls. I'm going to buy the doors for these cabinets from a manufacturer in bulk, and all cabinet doors I buy will be the exact same width, which I can specify. The width of the doors I'm ordering is what I'm trying to calculate.
One wall of the kitchen is 15' long, and one is 9' long. (The walls don't connect)
I want the maximum number of cabinet doors possible on each wall. The doors must all be the same width because I'm buying in bulk, but also conform to a minimum width and maximum width that a cabinet door must have to be functional.
And so I need an equation that let's me input:

*

*A base-width (BW) for cabinet doors.

*A maximum width (MW) for cabinet doors.

*The size of wall A (WA)

*The size of wall B (WB)

And outputs the width of cabinet doors I should be ordering. So that I can have the maximum amount of doors possible on each wall, while ensuring all doors are the same width, but also within the min/max width range for cabinet doors.
 A: Note: \ means divide the quantities and ignore the remainder.
A=WA\BW = number of doors for wall A
B=WB\BW = number of doors for wall B
IF (A>0) AND (B>0) THEN
MIN(WA/A , WB/B, MW) = door size
A: For simplicity I will use the following notation:

*

*$L_1, L_2$ for the lengths of wall one and two,


*$w_{min}$ for the minimum width of a cabinet,


*$w_{max}$ for the maximum width of a cabinet.
Let $c$ be the maximum number of cabinets we can put on the walls.
Let's also write $c_1$ for the maximum possible number of cabinets on wall one
and $c_2$ for the maximum number of cabinets on wall two.
We can achieve $c$ cabinets by making all the cabinets as small as possible,
this allows us to calculate $c$ as follows. Note that the walls are not connected so we must treat them separately:
$$ c_1 = \left[ \frac{L_1}{w_{min}} \right]$$
$$ c_2 = \left[ \frac{L_1}{w_{min}} \right]$$
$$c = c_1 + c_2 $$
where $[x]$ means the integer part of $x$ (since $x$ is a positive number, $[x]$ is the same as removing the part after the decimal point).
The largest size of cabinet we could have that would give us $c_1$ cabinets on wall one is $L_1 / c_1$.
We cannot make the cabinets any bigger on this wall otherwise they would not fit.
Similarly the largest we could make the cabinets to have $c_2$ cabinets on wall two is $L_2 / c_2$.
So the largest size we can make the cabinets is
$$\min\left(w_{max}, \frac{L_1}{c_1}, \frac{L_2}{c_2}\right).$$
A: If you measure the width in inches, a width of $w$ will give you $\frac {180}w$ doors along the $15'$ wall and $\frac {108}w$ doors along the $9'$ wall.  If the fractions do not come out even, throw away any remainder.  To get the most doors you want to choose $w$ as small as possible.  This will make the cabinets quite narrow.  As you talk of a minimum width, you can just use that.  It will give you the most doors.
