leefletcher
New Member
- Joined
- Mar 22, 2018
- Messages
- 29
- Office Version
- 2019
- Platform
- Windows
How do I get the distinct count based on 2 columns using a Pivot Table? I did it 2 years ago and can't find my formulas or previous work.
Survey response data:
I'm using a pivot table so I can summarize the data into a table that is eventually used in a mailmerge. My struggle is with getting the distinct count and percentages of school types in the districts.
Desired results:
I've been working on this for 2 days. Any help is greatly appreciated.
Survey response data:
Area | Responder | District | School | Type | Elem | Mid |
Northeast | Andy | Green School District | Washington Elementary School | Elem | 1 | 0 |
Northeast | Beth | Green School District | Lincoln Middle School | Mid | 0 | 1 |
Northeast | Carol | Green School District | Washington Elementary School | Elem | 1 | 0 |
Northeast | Carol | Green School District | Jefferson Elementary School | Elem | 1 | 0 |
Northeast | David | Green School District | Jefferson Elementary School | Elem | 1 | 0 |
Northeast | Eric | Yellow School District | Bartlet Elementary School | Elem | 1 | 0 |
Northeast | Eric | Yellow School District | Meyer Middle School | Mid | 0 | 1 |
Northeast | Frank | Yellow School District | Bartlet Elementary School | Elem | 1 | 0 |
Southeast | George | Mauve School District | Jobs Junior High | Mid | 0 | 1 |
I'm using a pivot table so I can summarize the data into a table that is eventually used in a mailmerge. My struggle is with getting the distinct count and percentages of school types in the districts.
Desired results:
Area | District | Number of responses (Count of Responders) | Number of Schools (Distinct Count of Schools) | Number of Elementary Schools | Percentage of Schools that are Elementary Schools | Number of Middle Schools | Percentage of Schools that are Elementary Schools |
---|---|---|---|---|---|---|---|
Northeast | Green School District | 5 | 4 | 3 | 75% | 1 | 25% |
Northeast | Yellow School District | 3 | 2 | 1 | 50% | 1 | 50% |
Southeast | Mauve School District | 1 | 1 | 0 | 0% | 1 | 100% |
Area | Total Number of Districts | Total responses | Total schools | Total elementary schools | Percentage of elementary schools | Total middle schools | Percentage of middle schools |
---|---|---|---|---|---|---|---|
Northeast | 2 | 8 | 6 | 4 | 66% | 2 | 33% |
Southeast | 1 | 1 | 1 | 0 | 0% | 1 | 100% |
State Total | 3 | 9 | 7 | 4 | 57% | 3 | 43% |
I've been working on this for 2 days. Any help is greatly appreciated.