Consider:
Book1 |
---|
|
---|
| A | B | C | D | E | F | G |
---|
1 | | | | | | | |
---|
2 | | | | | | | |
---|
3 | TOTAL LENGTH OF ALL SHAPES | 70 | 70 | | | | |
---|
4 | | | | | | | |
---|
5 | SHAPES | Total QTY. | Length if 1 Unit | Length if 2 Units | Length if 3 Units | Length if 4 Units | |
---|
6 | Square | 1 | 10 | 20 | 30 | 40 | |
---|
7 | Right Triangle | 2 | 10 | 10 | 20 | 20 | |
---|
8 | Parallelogram | 3 | 10 | 18 | 26 | 38 | |
---|
9 | Triangle | 2 | 10 | 15 | 20 | 25 | |
---|
10 | Circle | 0 | 20 | 30 | 40 | 50 | |
---|
11 | Line | 8 | | | | | |
---|
12 | Rhombus | 3 | 1 | 2 | 3 | 4 | |
---|
13 | Octagon | 2 | 5 | 6 | 7 | 8 | |
---|
14 | | | | | | | |
---|
|
---|
The B3 is the same formula, just with the ranges enlarged and the SEQUENCE value increased. The formula is already designed to ignore empty cells, so as long as there's nothing below or to the right, it'll work just fine.
The C3 formula is designed to expand vertically based on the number of values in A6:A1000, so row 1000 is the top. But if you have something in that range not related to your table, that could cause problems. So you might just want to stick with the previous version anyway. It doesn't expand to the right, but that could be done too if you want, but it'll make the formula longer.
Which raises a point, all formulas use the B column to say how far to the right to grab the value, so it will work as long as the values in C5:F5 just increment by 1. If you do something like 1,2,3,4,5,10,20, etc., then we'd need to adapt the formula.
The formula is pretty basic, it uses the SEQUENCE to pick the row, and the B value to pick the column for that row. Then the INDEX looks up the values for each row and SUMs them. The 1/(1/ structure is to turn a 0 into a #DIV/0! error, otherwise INDEX interprets a 0 as a 1.
Hope this helps!