One value with multiple values within, need to calculate as a percentage

jimmysumpter

New Member
Joined
Jan 16, 2014
Messages
11
Hi guys,

My excel skills are somewhat limited (compared to many on here) so I hope the following makes sense!

I have a list of group ID codes, which contain 1 or more product codes within them.

Some product codes contain an "alternative" value (the actual value is irrelevant) and others do not. See example below

Group IDProduct CodeAlternative
56381240027160380
56381240028
56381240029160380
56381240030

<tbody>
</tbody>

Ultimately what I need to achieve is a percentage of how many product codes, within each group ID, contain an alternative.

So for the example above, group ID 56381 would have 50% codes with alternatives.

By counting the occurrences of a group ID and whether 1 particular code has an alternative I have calculated individual percentages against the size of the group e.g. product code 240027 (given a value of 1) divided by the total number of codes in the group (4), returns 0.25. Obviously doing this across the whole group would give my result (0.5 or 50%)

However some groups contain over 100 codes and the spreadsheet is 40K rows!

Any help is much appreciated, again apologies if it doesn't make sense!

Jimmy
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Group IDProduct CodeAlternative
56381240027160380
56381240028
56381240029160380
56381240030
563842400314
56384240032
56384240033
563842400345
56384240035
56384240036
56384240037
563842400386
56384240039
56384240040
Group IDprodcodesalternatives%
563814250
5638410330
formula in cell with prodcodes = 4
=SUMPRODUCT(($A$2:$A$15=F20)*1)
formula in cell with alternatives = 2
=SUMPRODUCT(($A$2:$A$15=F20)*($C$2:$C$15<>""))

<colgroup><col><col><col><col span="4"><col><col span="3"></colgroup><tbody>
</tbody>
 
Upvote 0
maybe first use a pivot table just to identify all prodids and use that as left column in the table i did for you
 
Upvote 0

Forum statistics

Threads
1,216,101
Messages
6,128,838
Members
449,471
Latest member
lachbee

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