Calculate percentage of selected range/category from a large set of data

BrownEagle143

New Member
Joined
Nov 14, 2018
Messages
2
Hi all, I am new to mrExcel. I have a typical requirement. Currently I have one document which as the inventory of the vehicles. I need to calculate the percentage of the number of vehicles by city in a new column. The sample data as follows
[TABLE="width: 326"]
<tbody>[TR]
[TD]Country[/TD]
[TD]State[/TD]
[TD]City[/TD]
[TD]Brand[/TD]
[TD]no of cars[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]illinois[/TD]
[TD]Chicago[/TD]
[TD]Hyundai[/TD]
[TD="align: right"]550[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]illinois[/TD]
[TD]Chicago[/TD]
[TD]Honda[/TD]
[TD="align: right"]1500[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]illinois[/TD]
[TD]Chicago[/TD]
[TD]Toyota[/TD]
[TD="align: right"]2500[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]illinois[/TD]
[TD]Chicago[/TD]
[TD]Ford[/TD]
[TD="align: right"]2200[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]illinois[/TD]
[TD]Chicago[/TD]
[TD]Chevrolet[/TD]
[TD="align: right"]1200[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]illinois[/TD]
[TD]Chicago[/TD]
[TD]Kia[/TD]
[TD="align: right"]450[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]illinois[/TD]
[TD]Aurora[/TD]
[TD]Hyundai[/TD]
[TD="align: right"]800[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]illinois[/TD]
[TD]Aurora[/TD]
[TD]Honda[/TD]
[TD="align: right"]1200[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]illinois[/TD]
[TD]Aurora[/TD]
[TD]Toyota[/TD]
[TD="align: right"]1242[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]illinois[/TD]
[TD]Aurora[/TD]
[TD]Ford[/TD]
[TD="align: right"]2750[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]illinois[/TD]
[TD]Rockford[/TD]
[TD]Toyota[/TD]
[TD="align: right"]758[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]illinois[/TD]
[TD]Rockford[/TD]
[TD]Ford[/TD]
[TD="align: right"]350[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]Indiana[/TD]
[TD]Indianapolis[/TD]
[TD]Hyundai[/TD]
[TD="align: right"]550[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]Indiana[/TD]
[TD]Indianapolis[/TD]
[TD]Honda[/TD]
[TD="align: right"]2458[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]Indiana[/TD]
[TD]Indianapolis[/TD]
[TD]Toyota[/TD]
[TD="align: right"]3685[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]Indiana[/TD]
[TD]Indianapolis[/TD]
[TD]Ford[/TD]
[TD="align: right"]1520[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]Indiana[/TD]
[TD]Indianapolis[/TD]
[TD]Chevrolet[/TD]
[TD="align: right"]2544[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]Indiana[/TD]
[TD]Indianapolis[/TD]
[TD]Kia[/TD]
[TD="align: right"]854[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]Indiana[/TD]
[TD]Indianapolis[/TD]
[TD]Audi[/TD]
[TD="align: right"]450[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]Indiana[/TD]
[TD]Indianapolis[/TD]
[TD]BMW[/TD]
[TD="align: right"]358[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]Indiana[/TD]
[TD]Fort Wayne[/TD]
[TD]Hyundai[/TD]
[TD="align: right"]230[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]Indiana[/TD]
[TD]Fort Wayne[/TD]
[TD]Honda[/TD]
[TD="align: right"]1245[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]Indiana[/TD]
[TD]Fort Wayne[/TD]
[TD]Toyota[/TD]
[TD="align: right"]3551[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]Indiana[/TD]
[TD]Fort Wayne[/TD]
[TD]Ford[/TD]
[TD="align: right"]784[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]Indiana[/TD]
[TD]South Bend[/TD]
[TD]Hyundai[/TD]
[TD="align: right"]1255[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]Indiana[/TD]
[TD]Fort Wayne[/TD]
[TD]Honda[/TD]
[TD="align: right"]358[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]Indiana[/TD]
[TD]Fort Wayne[/TD]
[TD]Toyota[/TD]
[TD="align: right"]712[/TD]
[/TR]
</tbody>[/TABLE]


I need to calculate the percentage of vehicles in the next column by city in the following format

[TABLE="width: 425"]
<tbody>[TR]
[TD]Country[/TD]
[TD]State[/TD]
[TD]City[/TD]
[TD]Brand[/TD]
[TD]no of cars[/TD]
[TD]percentage[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]illinois[/TD]
[TD]Chicago[/TD]
[TD]Hyundai[/TD]
[TD="align: right"]550[/TD]
[TD="align: right"]6.55[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]illinois[/TD]
[TD]Chicago[/TD]
[TD]Honda[/TD]
[TD="align: right"]1500[/TD]
[TD="align: right"]17.86[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]illinois[/TD]
[TD]Chicago[/TD]
[TD]Toyota[/TD]
[TD="align: right"]2500[/TD]
[TD="align: right"]29.76[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]illinois[/TD]
[TD]Chicago[/TD]
[TD]Ford[/TD]
[TD="align: right"]2200[/TD]
[TD="align: right"]26.19[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]illinois[/TD]
[TD]Chicago[/TD]
[TD]Chevrolet[/TD]
[TD="align: right"]1200[/TD]
[TD="align: right"]14.29[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]illinois[/TD]
[TD]Chicago[/TD]
[TD]Kia[/TD]
[TD="align: right"]450[/TD]
[TD="align: right"]5.36[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]illinois[/TD]
[TD]Chicago Total[/TD]
[TD][/TD]
[TD="align: right"]8400[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]illinois[/TD]
[TD]Aurora[/TD]
[TD]Hyundai[/TD]
[TD="align: right"]800[/TD]
[TD="align: right"]13.35[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]illinois[/TD]
[TD]Aurora[/TD]
[TD]Honda[/TD]
[TD="align: right"]1200[/TD]
[TD="align: right"]20.03[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]illinois[/TD]
[TD]Aurora[/TD]
[TD]Toyota[/TD]
[TD="align: right"]1242[/TD]
[TD="align: right"]20.73[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]illinois[/TD]
[TD]Aurora[/TD]
[TD]Ford[/TD]
[TD="align: right"]2750[/TD]
[TD="align: right"]45.89[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]illinois[/TD]
[TD]Aurora Total[/TD]
[TD][/TD]
[TD="align: right"]5992[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]illinois[/TD]
[TD]Rockford[/TD]
[TD]Toyota[/TD]
[TD="align: right"]758[/TD]
[TD="align: right"]68.41[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]illinois[/TD]
[TD]Rockford[/TD]
[TD]Ford[/TD]
[TD="align: right"]350[/TD]
[TD="align: right"]31.59[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]illinois[/TD]
[TD]Rockford Total[/TD]
[TD][/TD]
[TD="align: right"]1108[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]Indiana[/TD]
[TD]Indianapolis[/TD]
[TD]Hyundai[/TD]
[TD="align: right"]550[/TD]
[TD="align: right"]4.43[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]Indiana[/TD]
[TD]Indianapolis[/TD]
[TD]Honda[/TD]
[TD="align: right"]2458[/TD]
[TD="align: right"]19.79[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]Indiana[/TD]
[TD]Indianapolis[/TD]
[TD]Toyota[/TD]
[TD="align: right"]3685[/TD]
[TD="align: right"]29.67[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]Indiana[/TD]
[TD]Indianapolis[/TD]
[TD]Ford[/TD]
[TD="align: right"]1520[/TD]
[TD="align: right"]12.24[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]Indiana[/TD]
[TD]Indianapolis[/TD]
[TD]Chevrolet[/TD]
[TD="align: right"]2544[/TD]
[TD="align: right"]20.48[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]Indiana[/TD]
[TD]Indianapolis[/TD]
[TD]Kia[/TD]
[TD="align: right"]854[/TD]
[TD="align: right"]6.88[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]Indiana[/TD]
[TD]Indianapolis[/TD]
[TD]Audi[/TD]
[TD="align: right"]450[/TD]
[TD="align: right"]3.62[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]Indiana[/TD]
[TD]Indianapolis[/TD]
[TD]BMW[/TD]
[TD="align: right"]358[/TD]
[TD="align: right"]2.88[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]Indiana[/TD]
[TD]Indianapolis Total[/TD]
[TD][/TD]
[TD="align: right"]12419[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]Indiana[/TD]
[TD]Fort Wayne[/TD]
[TD]Hyundai[/TD]
[TD="align: right"]230[/TD]
[TD="align: right"]3.96[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]Indiana[/TD]
[TD]Fort Wayne[/TD]
[TD]Honda[/TD]
[TD="align: right"]1245[/TD]
[TD="align: right"]21.43[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]Indiana[/TD]
[TD]Fort Wayne[/TD]
[TD]Toyota[/TD]
[TD="align: right"]3551[/TD]
[TD="align: right"]61.12[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]Indiana[/TD]
[TD]Fort Wayne[/TD]
[TD]Ford[/TD]
[TD="align: right"]784[/TD]
[TD="align: right"]13.49[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]Indiana[/TD]
[TD]Fort Wayne Total[/TD]
[TD][/TD]
[TD="align: right"]5810[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]Indiana[/TD]
[TD]South Bend[/TD]
[TD]Hyundai[/TD]
[TD="align: right"]1255[/TD]
[TD="align: right"]53.98[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]Indiana[/TD]
[TD]South Bend[/TD]
[TD]Honda[/TD]
[TD="align: right"]358[/TD]
[TD="align: right"]15.40[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]Indiana[/TD]
[TD]South Bend[/TD]
[TD]Toyota[/TD]
[TD="align: right"]712[/TD]
[TD="align: right"]30.62[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]Indiana[/TD]
[TD]South Bend Total[/TD]
[TD][/TD]
[TD="align: right"]2325[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


Thanks in Advance.
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Hi & welcome to MrExcel.
How about
=E2/SUMIF($C$2:$C$28,C2,$E$2:$E$28)
 
Upvote 0
Glad to help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,224,818
Messages
6,181,152
Members
453,021
Latest member
Justyna P

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