I have a table that I want to count the unique values based on; "Year-Month", "Type" and "District". Within those results I want to only count the unique "Job Numbers".
This table is a simplified version of the larger table. The "Year-Month", "Type" and "District" all meet the criteria I want, in the real table these values will not always match.
All 13 items match the criteria for "Year" = 2024, "Type" = CON and "District" = 71, I have the following formula to look for this combination:
Within these results there are 7 unique Job Numbers. I want to have a formula that looks for the "Year", "Type" and "District" but then looks for the unique Job Numbers within these results. I would need this all as one formula. So the final value I am looking for would be 7 from the table above
This table is a simplified version of the larger table. The "Year-Month", "Type" and "District" all meet the criteria I want, in the real table these values will not always match.
Year - Month | Job Number | Type | District |
2024 - 03 March | 71D0097 | CON | 71 |
2024 - 01 January | 71D0099 | CON | 71 |
2024 - 01 January | 71D0099 | CON | 71 |
2024 - 01 January | 71D0102 | CON | 71 |
2024 - 04 April | 71D0102 | CON | 71 |
2024 - 01 January | 71D0103 | CON | 71 |
2024 - 01 January | 71D0105 | CON | 71 |
2024 - 01 January | 71D0106 | CON | 71 |
2024 - 01 January | 71D0106 | CON | 71 |
2024 - 01 January | 71D0107 | CON | 71 |
2024 - 01 January | 71D0107 | CON | 71 |
2024 - 01 January | 71D0108 | CON | 71 |
2024 - 04 April | 71D0108 | CON | 71 |
13 | |||
Unique Job #'s | 7 |
All 13 items match the criteria for "Year" = 2024, "Type" = CON and "District" = 71, I have the following formula to look for this combination:
VBA Code:
SUMPRODUCT(--(C2:C14="CON"),--(TEXT(D2:D14,0)="71"),--(LEFT(A2:A14,4)="2024"))
Within these results there are 7 unique Job Numbers. I want to have a formula that looks for the "Year", "Type" and "District" but then looks for the unique Job Numbers within these results. I would need this all as one formula. So the final value I am looking for would be 7 from the table above