Hi
I have product by customer (product x customer) spread sheet where I need to identify the top 10% items and bottom 10% items (by values) and give them some colour. A sample array is given below in line on this query. A sample spread sheet with the same data is uploaded to bit.ly/1Ts5AZk
The actual spread sheet has 1000s of lines and so a VBA is kindly requested to shade the top and bottom 10%s
I'm using Excel 2010 on a win 2000 machine. I have tried to search Mr Excel, but couldn't find a proper VBA... so even pointers to the right thread would be most appreciated. Any help would be most appreciated.
Sample :
[TABLE="width: 814"]
<tbody>[TR]
[TD]Product[/TD]
[TD]customer[/TD]
[TD]Kilos[/TD]
[TD]$ / KG[/TD]
[TD]comments [/TD]
[TD]comments[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]product 1[/TD]
[TD]customer 1[/TD]
[TD]10 KG[/TD]
[TD]2.00[/TD]
[TD]=> bottom 10% (out of 10 cases) in av. sale price[/TD]
[TD]=> say colour red[/TD]
[/TR]
[TR]
[TD]product 1[/TD]
[TD]customer 2[/TD]
[TD]20 KG[/TD]
[TD]2.10[/TD]
[TD][/TD]
[TD]No colour[/TD]
[/TR]
[TR]
[TD]product 1[/TD]
[TD]customer 3[/TD]
[TD]30 KG[/TD]
[TD]2.70[/TD]
[TD][/TD]
[TD]No colour[/TD]
[/TR]
[TR]
[TD]product 1[/TD]
[TD]customer 4[/TD]
[TD]50 KG[/TD]
[TD]3.10[/TD]
[TD][/TD]
[TD]No colour[/TD]
[/TR]
[TR]
[TD]product 1[/TD]
[TD]customer 5[/TD]
[TD]60 KG[/TD]
[TD]4.00[/TD]
[TD][/TD]
[TD]No colour[/TD]
[/TR]
[TR]
[TD]product 1[/TD]
[TD]customer 6[/TD]
[TD]60 KG[/TD]
[TD]2.50[/TD]
[TD][/TD]
[TD]No colour[/TD]
[/TR]
[TR]
[TD]product 1[/TD]
[TD]customer 7[/TD]
[TD]70 KG[/TD]
[TD]8.00[/TD]
[TD]=> top 10% (out of 10 cases) in Av. Sale price[/TD]
[TD]=> colour Green[/TD]
[/TR]
[TR]
[TD]product 1[/TD]
[TD]customer 8[/TD]
[TD]80 KG[/TD]
[TD]8.00[/TD]
[TD] - do -[/TD]
[TD]=> colour Green[/TD]
[/TR]
[TR]
[TD]product 1[/TD]
[TD]customer 9[/TD]
[TD]90 KG[/TD]
[TD]3.00[/TD]
[TD][/TD]
[TD]No colour[/TD]
[/TR]
[TR]
[TD]product 1[/TD]
[TD]customer 10[/TD]
[TD]100 KG[/TD]
[TD]5.00[/TD]
[TD][/TD]
[TD]No colour[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]product 2[/TD]
[TD]customer 1[/TD]
[TD]100KG[/TD]
[TD]13.10[/TD]
[TD][/TD]
[TD]No colour[/TD]
[/TR]
[TR]
[TD]product 2[/TD]
[TD]customer 2[/TD]
[TD]200KG[/TD]
[TD]12.10[/TD]
[TD][/TD]
[TD]No colour[/TD]
[/TR]
[TR]
[TD]product 2[/TD]
[TD]customer 3[/TD]
[TD]300KG[/TD]
[TD]12.70[/TD]
[TD][/TD]
[TD]No colour[/TD]
[/TR]
[TR]
[TD]product 2[/TD]
[TD]customer 4[/TD]
[TD]500KG[/TD]
[TD]12.00[/TD]
[TD]=> bottom 10% (out of 10 cases) in av. sale price[/TD]
[TD]=> colour red[/TD]
[/TR]
[TR]
[TD]product 2[/TD]
[TD]customer 5[/TD]
[TD]600KG[/TD]
[TD]14.00[/TD]
[TD][/TD]
[TD]No colour[/TD]
[/TR]
[TR]
[TD]product 2[/TD]
[TD]customer 6[/TD]
[TD]600KG[/TD]
[TD]12.50[/TD]
[TD][/TD]
[TD]No colour[/TD]
[/TR]
[TR]
[TD]product 2[/TD]
[TD]customer 7[/TD]
[TD]705KG[/TD]
[TD]18.00[/TD]
[TD]=> top 10% (out of 10 cases) in Av. Sale price[/TD]
[TD]=> colour Green[/TD]
[/TR]
[TR]
[TD]product 2[/TD]
[TD]customer 8[/TD]
[TD]801KG[/TD]
[TD]18.00[/TD]
[TD]- do -[/TD]
[TD]=> colour Green[/TD]
[/TR]
[TR]
[TD]product 2[/TD]
[TD]customer 9[/TD]
[TD]904KG[/TD]
[TD]13.00[/TD]
[TD][/TD]
[TD]No colour[/TD]
[/TR]
[TR]
[TD]product 2[/TD]
[TD]customer 10[/TD]
[TD]185KG[/TD]
[TD]15.00[/TD]
[TD][/TD]
[TD]No colour[/TD]
[/TR]
</tbody>[/TABLE]
...and so on ....
Thanks and regards
Subu
I have product by customer (product x customer) spread sheet where I need to identify the top 10% items and bottom 10% items (by values) and give them some colour. A sample array is given below in line on this query. A sample spread sheet with the same data is uploaded to bit.ly/1Ts5AZk
The actual spread sheet has 1000s of lines and so a VBA is kindly requested to shade the top and bottom 10%s
I'm using Excel 2010 on a win 2000 machine. I have tried to search Mr Excel, but couldn't find a proper VBA... so even pointers to the right thread would be most appreciated. Any help would be most appreciated.
Sample :
[TABLE="width: 814"]
<tbody>[TR]
[TD]Product[/TD]
[TD]customer[/TD]
[TD]Kilos[/TD]
[TD]$ / KG[/TD]
[TD]comments [/TD]
[TD]comments[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]product 1[/TD]
[TD]customer 1[/TD]
[TD]10 KG[/TD]
[TD]2.00[/TD]
[TD]=> bottom 10% (out of 10 cases) in av. sale price[/TD]
[TD]=> say colour red[/TD]
[/TR]
[TR]
[TD]product 1[/TD]
[TD]customer 2[/TD]
[TD]20 KG[/TD]
[TD]2.10[/TD]
[TD][/TD]
[TD]No colour[/TD]
[/TR]
[TR]
[TD]product 1[/TD]
[TD]customer 3[/TD]
[TD]30 KG[/TD]
[TD]2.70[/TD]
[TD][/TD]
[TD]No colour[/TD]
[/TR]
[TR]
[TD]product 1[/TD]
[TD]customer 4[/TD]
[TD]50 KG[/TD]
[TD]3.10[/TD]
[TD][/TD]
[TD]No colour[/TD]
[/TR]
[TR]
[TD]product 1[/TD]
[TD]customer 5[/TD]
[TD]60 KG[/TD]
[TD]4.00[/TD]
[TD][/TD]
[TD]No colour[/TD]
[/TR]
[TR]
[TD]product 1[/TD]
[TD]customer 6[/TD]
[TD]60 KG[/TD]
[TD]2.50[/TD]
[TD][/TD]
[TD]No colour[/TD]
[/TR]
[TR]
[TD]product 1[/TD]
[TD]customer 7[/TD]
[TD]70 KG[/TD]
[TD]8.00[/TD]
[TD]=> top 10% (out of 10 cases) in Av. Sale price[/TD]
[TD]=> colour Green[/TD]
[/TR]
[TR]
[TD]product 1[/TD]
[TD]customer 8[/TD]
[TD]80 KG[/TD]
[TD]8.00[/TD]
[TD] - do -[/TD]
[TD]=> colour Green[/TD]
[/TR]
[TR]
[TD]product 1[/TD]
[TD]customer 9[/TD]
[TD]90 KG[/TD]
[TD]3.00[/TD]
[TD][/TD]
[TD]No colour[/TD]
[/TR]
[TR]
[TD]product 1[/TD]
[TD]customer 10[/TD]
[TD]100 KG[/TD]
[TD]5.00[/TD]
[TD][/TD]
[TD]No colour[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]product 2[/TD]
[TD]customer 1[/TD]
[TD]100KG[/TD]
[TD]13.10[/TD]
[TD][/TD]
[TD]No colour[/TD]
[/TR]
[TR]
[TD]product 2[/TD]
[TD]customer 2[/TD]
[TD]200KG[/TD]
[TD]12.10[/TD]
[TD][/TD]
[TD]No colour[/TD]
[/TR]
[TR]
[TD]product 2[/TD]
[TD]customer 3[/TD]
[TD]300KG[/TD]
[TD]12.70[/TD]
[TD][/TD]
[TD]No colour[/TD]
[/TR]
[TR]
[TD]product 2[/TD]
[TD]customer 4[/TD]
[TD]500KG[/TD]
[TD]12.00[/TD]
[TD]=> bottom 10% (out of 10 cases) in av. sale price[/TD]
[TD]=> colour red[/TD]
[/TR]
[TR]
[TD]product 2[/TD]
[TD]customer 5[/TD]
[TD]600KG[/TD]
[TD]14.00[/TD]
[TD][/TD]
[TD]No colour[/TD]
[/TR]
[TR]
[TD]product 2[/TD]
[TD]customer 6[/TD]
[TD]600KG[/TD]
[TD]12.50[/TD]
[TD][/TD]
[TD]No colour[/TD]
[/TR]
[TR]
[TD]product 2[/TD]
[TD]customer 7[/TD]
[TD]705KG[/TD]
[TD]18.00[/TD]
[TD]=> top 10% (out of 10 cases) in Av. Sale price[/TD]
[TD]=> colour Green[/TD]
[/TR]
[TR]
[TD]product 2[/TD]
[TD]customer 8[/TD]
[TD]801KG[/TD]
[TD]18.00[/TD]
[TD]- do -[/TD]
[TD]=> colour Green[/TD]
[/TR]
[TR]
[TD]product 2[/TD]
[TD]customer 9[/TD]
[TD]904KG[/TD]
[TD]13.00[/TD]
[TD][/TD]
[TD]No colour[/TD]
[/TR]
[TR]
[TD]product 2[/TD]
[TD]customer 10[/TD]
[TD]185KG[/TD]
[TD]15.00[/TD]
[TD][/TD]
[TD]No colour[/TD]
[/TR]
</tbody>[/TABLE]
...and so on ....
Thanks and regards
Subu