Looking for a single ArrayFormula which can populate a matrix calculation where the row and columns are dynamically generated from separate lists.
I have a working ArrayFormula for a single column, but cannot work out how to have this formula auto-populate as new columns are added.
There are separate sheets with Products and Companies. Each Product has attributes Height, Width, and Depth. Each company has criteria for each Height, Width, Depth attribute. A matrix is populated indicating whether a product Height, Width, and Depth fall within the constraints of each company.
Product.Height <= Company.Height AND Product.Width <= Company.Width AND Product.Depth <= Company.Depth

Columns K and L are auto-populated using ArrayFormulas (K3 =query(A3:A,"select A") and L2 =transpose(query(F3:F7,"select F"))) allowing new Products and Companies to be added without having to separately maintain the Matrix.
The ArrayFormula copied across L3:P3 shows the desired result for single Company column:
=arrayformula(
if(
vlookup(indirect("K3:K"&counta($A3:$A)+2),indirect("A3:D"&counta($A3:$A)+2),2,0)<=vlookup(L$2,indirect("F3:I"&counta($F3:$F)+2),2,0),
if(
vlookup(indirect("K3:K"&counta($A3:$A)+2),indirect("A3:D"&counta($A3:$A)+2),3,0)<=vlookup(L$2,indirect("F3:I"&counta($F3:$F)+2),3,0),
if (
vlookup(indirect("K3:K"&counta($A3:$A)+2),indirect("A3:D"&counta($A3:$A)+2),4,0)<=vlookup(L$2,indirect("F3:I"&counta($F3:$F)+2),4,0),
"✔",
"✗"
),
"✗"
),
"✗"
)
)
The goal is to paste a single ArrayFormula in a cell, likely L3, allowing new Companies to be added without needing to manually copy/paste the ArrayFormula across the new Company columns.
The sample sheet combines Products, Companies, and the Matrix into a single sheet for simplicity.
Products A2:D7
| Products | Height | Width | Depth |
|---|---|---|---|
| Product 1 | 10 | 10 | 10 |
| Product 2 | 20 | 20 | 20 |
| Product 3 | 25 | 30 | 30 |
| Product 4 | 30 | 35 | 35 |
| Product 5 | 50 | 50 | 50 |
Companies F2:I7
| Company | Height | Width | Depth |
|---|---|---|---|
| Company 1 | 5 | 5 | 5 |
| Company 2 | 20 | 20 | 20 |
| Company 3 | 25 | 25 | 25 |
| Company 4 | 30 | 35 | 35 |
| Company 5 | 25 | 25 | 25 |
