Simple VBA percentage

mmetzinger

Board Regular
Joined
Dec 30, 2010
Messages
61
Ok, so I have the following data on a sheet.

<table border="0" cellpadding="0" cellspacing="0" height="147" width="329"><col style="mso-width-source:userset;mso-width-alt:5006;width:106pt" width="141"> <col style="mso-width-source:userset;mso-width-alt:2645;width:56pt" width="74"> <col style="mso-width-source:userset;mso-width-alt:2389;width:50pt" width="67"> <tbody><tr style="mso-height-source:userset;height:17.25pt" height="22"> <td class="xl65" style="height:17.25pt;width:106pt" height="22" width="141">Name</td> <td class="xl65" style="border-left:none;width:56pt" width="74">Action</td> <td class="xl65" style="border-left:none;width:50pt" width="67">Count</td> </tr> <tr style="mso-outline-level:2;height:13.2pt" height="18"> <td class="xl67" style="height:13.2pt;border-top:none" height="18">SMITH,BOB</td> <td class="xl67" style="border-top:none;border-left:none">NOTAK Count</td> <td class="xl66" style="border-top:none;border-left:none" align="right">1</td> </tr> <tr style="mso-outline-level:2;height:13.2pt" height="18"> <td class="xl67" style="height:13.2pt;border-top:none" height="18">SMITH,BOB</td> <td class="xl67" style="border-top:none;border-left:none">PEND Count</td> <td class="xl66" style="border-top:none;border-left:none" align="right">1</td> </tr> <tr style="mso-outline-level:2;height:13.2pt" height="18"> <td class="xl67" style="height:13.2pt;border-top:none" height="18">SMITH,BOB</td> <td class="xl67" style="border-top:none;border-left:none">PRMPY Count</td> <td class="xl66" style="border-top:none;border-left:none" align="right">18</td> </tr> <tr style="mso-outline-level:1;height:13.2pt" height="18"> <td class="xl69" style="height:13.2pt" height="18">SMITH,BOB Total</td> <td class="xl67" style="border-top:none"> </td> <td class="xl68" align="right">20</td> </tr> <tr style="mso-outline-level:2;height:13.2pt" height="18"> <td class="xl69" style="height:13.2pt" height="18">DOE, JANE</td> <td class="xl67" style="border-top:none">PEND Count</td> <td class="xl68" align="right">5
</td> </tr> <tr style="mso-outline-level:2;height:13.2pt" height="18"> <td class="xl69" style="height:13.2pt" height="18">DOE, JANE</td> <td class="xl69">PRMPY Count</td> <td class="xl68" align="right">3
</td> </tr> <tr style="mso-outline-level:1;height:13.2pt" height="18"> <td class="xl69" style="height:13.2pt" height="18">DOE, JANE Total</td> <td class="xl69">
</td> <td class="xl68" align="right">8</td> </tr> </tbody></table>
This comes from a subtotal of Name > Sum > Count

What I need now is an percentage of total for each action based off of the name field. My issue is the different action categories are not always the same and thus I can't base it off of hard cell bindings. Does anyone know of an easy way to get the percent of total for each action?

In the end I would like
Name Action Count % of total
Jane Doe Pend 5 60%
Jane Doe PRMPY 3 40%
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Try a PivotTable. They are very handy for summarizing information like this.
 
Upvote 0
Ok, well I am horrible with pivot tables. Would anyone be able to shed some light on how to build the pivot table correctly to accomplish this?
 
Upvote 0

Forum statistics

Threads
1,213,515
Messages
6,114,080
Members
448,548
Latest member
harryls

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top