The 6th grade has taken a count of everyone's pets by type, then grouped them into larger categories. I'm trying to take that data and produce automatically a report that shows the count of each type of pet within each group, ordered by the largest group to the smallest.
I have a table that shows the count of each pet type:
I also have a summary table that adds up each group's total and finds their rank:
This is what my output should look like:
I'm trying to write a formula that starts with the Title of the top group, then lists (in order) the type of pets in that group, then displays the name of the second group, etc., etc. until all of the groups and types are listed, in order.
Can this be done formulaically, instead of with VBA?
I have a table that shows the count of each pet type:
Book1 | |||||
---|---|---|---|---|---|
A | B | C | |||
1 | Pet Type | Pet Group | Count | ||
2 | Mutt | Dog | 38 | ||
3 | Mixed Breed | Cat | 28 | ||
4 | Tabby | Cat | 24 | ||
5 | Terrier | Dog | 12 | ||
6 | Goldfish | Fish | 6 | ||
7 | Boxer | Dog | 4 | ||
8 | Guppy | Fish | 4 | ||
9 | Mastiff | Dog | 3 | ||
10 | Python | Reptile | 3 | ||
11 | Guinea Pig | Rodent | 3 | ||
12 | Siamese | Cat | 2 | ||
13 | Iguana | Reptile | 2 | ||
14 | Mouse | Rodent | 2 | ||
15 | Oscar | Fish | 2 | ||
16 | Mexican Hairless | Cat | 1 | ||
17 | Bullfrog | Reptile | 1 | ||
Sheet1 |
I also have a summary table that adds up each group's total and finds their rank:
Book1 | |||||
---|---|---|---|---|---|
E | F | G | |||
1 | Pet Group | Total Count | Rank | ||
2 | Dogs | 57 | 1 | ||
3 | Cats | 55 | 2 | ||
4 | Fish | 12 | 3 | ||
5 | Reptiles | 6 | 4 | ||
6 | Rodents | 5 | 5 | ||
Sheet1 |
This is what my output should look like:
Book1 | ||||
---|---|---|---|---|
I | J | |||
1 | Group/Type | Total Count | ||
2 | Dogs | |||
3 | Mutt | 38 | ||
4 | Terrier | 12 | ||
5 | Boxer | 4 | ||
6 | Mastiff | 3 | ||
7 | Cats | |||
8 | Mixed Breed | 28 | ||
9 | Tabby | 24 | ||
10 | Siamese | 2 | ||
11 | Mexican Hairless | 1 | ||
12 | Fish | |||
13 | Goldfish | 6 | ||
14 | Guppy | 4 | ||
15 | Oscar | 2 | ||
16 | Reptiles | |||
17 | Python | 3 | ||
18 | Iguana | 2 | ||
19 | Bullfrog | 1 | ||
20 | Rodents | |||
21 | Guinea Pig | 3 | ||
22 | Mouse | 2 | ||
Sheet1 |
I'm trying to write a formula that starts with the Title of the top group, then lists (in order) the type of pets in that group, then displays the name of the second group, etc., etc. until all of the groups and types are listed, in order.
Can this be done formulaically, instead of with VBA?