Just to be safe, could you post a small sample along with desired result?
Okay, to simplify I'll use cols A:E
[TABLE="width: 285"]
<colgroup><col width="102" style="width: 77pt; mso-width-source: userset; mso-width-alt: 3640;"> <col width="76" style="width: 57pt; mso-width-source: userset; mso-width-alt: 2702;"> <col width="73" style="width: 55pt; mso-width-source: userset; mso-width-alt: 2588;"> <col width="64" style="width: 48pt;" span="2"> <tbody>[TR]
[TD="width: 102, bgcolor: white"]
A[/TD]
[TD="width: 76, bgcolor: white"]
B[/TD]
[TD="width: 73, bgcolor: white"]
C[/TD]
[TD="width: 64, bgcolor: white"]
D[/TD]
[TD="width: 64, bgcolor: white"]
E[/TD]
[/TR]
[TR]
[TD="bgcolor: white"]
Status[/TD]
[TD="bgcolor: white"]
Date[/TD]
[TD="bgcolor: white"]
Dept[/TD]
[TD="bgcolor: white"]
PO No[/TD]
[TD="bgcolor: white"]
Days
[/TD]
[/TR]
[TR]
[TD="width: 102, bgcolor: white"]
In Process[/TD]
[TD="bgcolor: white"]
01/02/2019[/TD]
[TD="bgcolor: white"]
IT[/TD]
[TD="width: 64, bgcolor: #92D050"]
PO1[/TD]
[TD="bgcolor: #92D050"]
2 Days[/TD]
[/TR]
[TR]
[TD="width: 102, bgcolor: white"]
In Process[/TD]
[TD="bgcolor: white"]
01/01/2019[/TD]
[TD="bgcolor: white"]
Sales[/TD]
[TD="width: 64, bgcolor: #E26B0A"]
PO3[/TD]
[TD="bgcolor: #E26B0A"]
5 Days[/TD]
[/TR]
[TR]
[TD="width: 102, bgcolor: white"]
In Process[/TD]
[TD="bgcolor: white"]
31/01/2019[/TD]
[TD="bgcolor: white"]
IT[/TD]
[TD="width: 64, bgcolor: #92D050"]
PO2[/TD]
[TD="bgcolor: #92D050"]
1 Day[/TD]
[/TR]
[TR]
[TD="width: 102, bgcolor: white"]
In Process[/TD]
[TD="bgcolor: white"]
13/02/2019[/TD]
[TD="bgcolor: white"]
IT[/TD]
[TD="width: 64, bgcolor: transparent"]
PO2[/TD]
[TD="bgcolor: transparent"]
1 Day[/TD]
[/TR]
[TR]
[TD="width: 102, bgcolor: white"]
On Hold[/TD]
[TD="bgcolor: white"]
10/01/2019[/TD]
[TD="bgcolor: white"]
Sales[/TD]
[TD="width: 64, bgcolor: white"]
PO4[/TD]
[TD="bgcolor: white"]
1 Day[/TD]
[/TR]
</tbody>[/TABLE]
I'm expecting to see:
[TABLE="width: 160"]
<colgroup><col width="76" style="width: 57pt; mso-width-source: userset; mso-width-alt: 2702;"> <col width="73" style="width: 55pt; mso-width-source: userset; mso-width-alt: 2588;"> <col width="64" style="width: 48pt;"> <tbody>[TR]
[TD="width: 76, bgcolor: transparent"] [/TD]
[TD="width: 73, bgcolor: white"]
Unique PRs
[/TD]
[TD="width: 64, bgcolor: white"]
Ave Days
[/TD]
[/TR]
[TR]
[TD="bgcolor: #92D050"]
IT[/TD]
[TD="bgcolor: transparent"]
2[/TD]
[TD="bgcolor: transparent"]
1.5 Days
[/TD]
[/TR]
[TR]
[TD="bgcolor: #E26B0A"]
Sales
[/TD]
[TD="bgcolor: transparent"]
1[/TD]
[TD="bgcolor: transparent"]
5 Days[/TD]
[/TR]
</tbody>[/TABLE]
So the third IT isn't counted as it is a repeat of PO2.
The second Sales isn't counted as it is On Hold.
All PO numbers that are the same code will have the same number of days