# Returning a percentage after a count

#### Yusuf

##### Active Member
Hi all

I'm trying to create a percentage of items by it's status at the time.

Eg;
Col A has the item Name and a Total or each item Name as in a pivot table
Col B has the item status, either Good or Bad

A2 to A9 = Apple
A10 = Apple Total
A11 to A15 = Pear

B2 to B9 = 5 Good and 3 Bad
B11 to B15 = 3 Good and 2 Bad

I need the formulas in Col C (only beside the Totals) to return a percentage of Good items according to the number of items but not count the fruit before/above and it's status.

My apologies if this is unclear but I've been thinking of better ways of writing it and hope this is the best.

### Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Hard to imagine why you opt for such a fragile kind of data representation...
Book2
ABCD
1ItemStatus
2AppleGood
4AppleGood
5AppleGood
6AppleGood
8AppleGood
1080.625
11PearGood
14PearGood
15PearGood
1650.6
Sheet1

A10:

=COUNTIF(A2:A9,"Apple")

B10:

=COUNTIF(B2:B9,"Good")/A10

Formulas are similar in A16 and B16.

My sincere apologies

In my example I stated the ranges but at the moment I've been given 12000 rows of data and the item totals are very different.

I put a formula in Col C (C2) to get a total of the items that reads;
=IF(A2=A1&" Total",countif(A1:A2,A2),"")

In C10 I get a total count of the Apples and C16 for the Pears

Is there a formula I can enter in Col D that takes this Total into account and be devided by the number of "Good"?

Replies
1
Views
317
Replies
11
Views
2K
Replies
5
Views
523
Replies
1
Views
182
Replies
8
Views
528

1,211,843
Messages
6,104,310
Members
447,901
Latest member
boy3hc2004

### 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.

### Which adblocker are you using?

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

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