Excel 2007, Windows 7.
Most details are shown in the spreadsheet below. I would like it to be dynamic because the quarterly and annual data dumps I'm working with are are hundreds to thousands of lines.
Have the list be sorted, which is a part of the first attempt, would be nice but is not necessary. At this point, just being able to generate the dynamic list would be fantastic.
Any thoughts or suggestions are much appreciated!
Thanks!
Most details are shown in the spreadsheet below. I would like it to be dynamic because the quarterly and annual data dumps I'm working with are are hundreds to thousands of lines.
Have the list be sorted, which is a part of the first attempt, would be nice but is not necessary. At this point, just being able to generate the dynamic list would be fantastic.
Any thoughts or suggestions are much appreciated!
Excel 2007 | |||||||
---|---|---|---|---|---|---|---|
A | B | C | D | E | |||
1 | product lines: | consist of these product subtypes | |||||
2 | Widget series: | Widget.type1 | Widget.type2 | ||||
3 | Fidget series: | Fidget.type | |||||
4 | Gidget series: | Gidget.type1 | Gidget.type2 | Gidget.type3 | |||
5 | |||||||
6 | data dump of parts sold or used in repairs | ||||||
7 | product subtype repaired | part number shipped | |||||
8 | Widget.type1 | a1 | |||||
9 | Fidget.type | a2 | |||||
10 | Gidget.type1 | a3 | |||||
11 | Gidget.type2 | a4 | |||||
12 | Gidget.type3 | a5 | |||||
13 | Fidget.type | a6 | |||||
14 | Widget.type2 | a7 | |||||
15 | Gidget.type2 | a8 | |||||
16 | Gidget.type2 | a9 | |||||
17 | Gidget.type3 | a10 | |||||
18 | Widget.type2 | a11 | |||||
19 | Widget.type1 | a12 | |||||
20 | |||||||
21 | |||||||
22 | My attempted calculations to summarize the instances of sales/repairs for each product line (i.e. "Widget series", etc): | ||||||
23 | |||||||
24 | |||||||
25 | First step, calculated the number of instances for each series | ||||||
26 | I defined three array constants containing the product subtypes for each product line: | ||||||
27 | below names are defined | "actual" array constant text saved to the names | |||||
28 | Widget series: | Widget.list | ={"Widget.type1","Widget.type2"} | ||||
29 | Fidget series: | Fidget.list | ="Fidget.type" | ||||
30 | Gidget series: | Gidget.list | ={"Gidget.type1","Gidget.type2","Gidget.type3"} | ||||
31 | |||||||
32 | This worked fine: | ||||||
33 | Widget series | Fidget series | Gidget series | ||||
34 | # of instances of each series | 4 | 2 | 6 | |||
35 | |||||||
36 | |||||||
37 | |||||||
38 | FAILED ATTEMPT NUMBER 1: Generate a dynamic, sorted and unique list of the part numbers shipped/used for each product line: | ||||||
39 | |||||||
40 | |||||||
41 | |||||||
42 | Widget series | Fidget series | Gidget series | ||||
43 | a1 | a2 | a3 | ||||
44 | FALSE | a6 | FALSE | ||||
45 | FALSE | FALSE | |||||
46 | a12 | FALSE | |||||
47 | FALSE | ||||||
48 | FALSE | ||||||
49 | |||||||
50 | Comments: It works for the 'Fidget' series, but not the others because the 'Fidget.list' array constant only has one element (only one product subtype). The logic of the 'IF' function in the 'SMALL' function is flawed for the other two ".list"s, that have multiple elements in the array constants. The 'IF' statement "logical test" has 'TRUE'S in the right spots (of the TWO dimensional array) for the 'Widget' and 'Gidget' lists (that will match the top level 'INDEX' function), but the 'ROW' function (in the [value if TRUE] spot of the 'IF') doesn't point to the right spot in the two dimensional array and therefore returns the wrong value (a "FALSE"). I need a "return the array location if TRUE" function. | ||||||
51 | |||||||
52 | |||||||
53 | |||||||
54 | |||||||
55 | |||||||
56 | |||||||
57 | |||||||
58 | |||||||
59 | FAILED ATTEMPT NUMBER 2: Gave up on sorted. Generate a dynamic and unique list of the part numbers shipped/used for each product line: | ||||||
60 | |||||||
61 | |||||||
62 | Widget series | Fidget series | Gidget series | ||||
63 | #NUM! | #NUM! | #NUM! | ||||
64 | #NUM! | #NUM! | #NUM! | ||||
65 | #NUM! | #NUM! | |||||
66 | #NUM! | #NUM! | |||||
67 | #NUM! | ||||||
68 | #NUM! | ||||||
69 | |||||||
70 | Comments: Without the sorting requirement, things could be much easier. I could just let 'SMALL' decide which is smallest to largest and report. But the 'SMALL' function apparantly isn't happy with things inside quotes, and I haven't found a clever way to remove them yet. | ||||||
71 | |||||||
72 | |||||||
73 | |||||||
Sheet11 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
B34 | {=SUM(IF($A$8:$A$19=Widget.list,1)*1)} | |
B43 | {=IF(ROWS(B$43:B43)<=B$34,INDEX(IF($A$8:$A$19=Widget.list,$B$8:$B$19),SMALL(IF($A$8:$A$19=Widget.list,ROW($A$8:$A$19)-ROW($A$8)+1),ROWS(B$43:B43))),"")} | |
B63 | {=IF(ROWS(B$63:B63)<=B$34,SMALL(IF($A$8:$A$19=Widget.list,$B$8:$B$19,"zzz"),ROWS(B$63:B63)),"")} | |
Press CTRL+SHIFT+ENTER to enter array formulas. |
Named Ranges | ||
---|---|---|
Name | Refers To | Cells |
Widget.list | ={"Widget.type1","Widget.type2"} |
Thanks!
Last edited: