Formula for calculating Percentages in a list

dave3944

Board Regular
Joined
Jan 22, 2005
Messages
139
I know there has to be a way to do this. Here's the problem: I have a list of items. I would like to calculate the percentage that each item is of the total. For instance, the list of parts includes 48 items consisting of 1's, 2's and 3's. I want to know what percentage of the total are the 1's. What percentage of the total are 2's, etc. I'm very familiar with VBA, but I need this to be a formula. I've experimented with COUNT, COUNTIF, DCOUNT, DCOUNTA and the other functions in Excel. I just know there has to be a way to combine one (or more) of these functions to accomplish the task.
Your help is greatly appreciated.
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
I know there has to be a way to do this. Here's the problem: I have a list of items. I would like to calculate the percentage that each item is of the total. For instance, the list of parts includes 48 items consisting of 1's, 2's and 3's. I want to know what percentage of the total are the 1's. What percentage of the total are 2's, etc. I'm very familiar with VBA, but I need this to be a formula. I've experimented with COUNT, COUNTIF, DCOUNT, DCOUNTA and the other functions in Excel. I just know there has to be a way to combine one (or more) of these functions to accomplish the task.
Your help is greatly appreciated.
Something like this...

For the percentage of 1s in the range:

=COUNTIF(A1:A10,1)/COUNT(A1:A10)

Format as Percentage
 
Upvote 0
I know there has to be a way to do this. Here's the problem: I have a list of items. I would like to calculate the percentage that each item is of the total. For instance, the list of parts includes 48 items consisting of 1's, 2's and 3's. I want to know what percentage of the total are the 1's. What percentage of the total are 2's, etc. I'm very familiar with VBA, but I need this to be a formula. I've experimented with COUNT, COUNTIF, DCOUNT, DCOUNTA and the other functions in Excel. I just know there has to be a way to combine one (or more) of these functions to accomplish the task.
Your help is greatly appreciated.

If your data is in A2:A100, you could use

Code:
=COUNTIF($A$2:$A$100,1)/COUNT($A$2:$A$100)

:)
 
Upvote 0
Thanks for the quick answers. I'm halfway there. It works fine with numbers. When I tried it with letters (a,b,c) I get a Division by 0 error. I changed the formula to =COUNTIF(A2:A46,"a")/COUNT(A2:A46), but still got the error. Any suggestions?
 
Upvote 0
Thanks for the quick answers. I'm halfway there. It works fine with numbers. When I tried it with letters (a,b,c) I get a Division by 0 error. I changed the formula to =COUNTIF(A2:A46,"a")/COUNT(A2:A46), but still got the error. Any suggestions?
If you have both TEXT entries and NUMERIC entries then replace COUNT with COUNTA.

=COUNTIF(A2:A46,"a")/COUNTA(A2:A46)

=COUNTIF(A2:A46,1)/COUNTA(A2:A46)
 
Upvote 0

Forum statistics

Threads
1,224,597
Messages
6,179,808
Members
452,944
Latest member
2558216095

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