Need help creating equation

4mathhelp

New member
Joined
May 28, 2019
Messages
2
I am trying to create an equation that will figure out automatically the correct numbers.

I will have a random number of groups (as many as 20).

Each group will be assigned a value of 2 or 1. I need to divide the groups into percentages that equal 100%. All the groups assigned a 2 need to be 1.5 more than all the groups assigned 1.

Example: If I have 4 groups and 2 are assigned 2 and 2 are assigned 1, I need an output that equals 30%, 30%, 20%, 20%.

Thanks for any help.
 
Lets look at an example:
If there are 10 groups with 4 assigned an A and the other 6 assigned a B.
(I'm using A and B rather than 2 and 1, because 2 and 1 don't come into the calculations.)
To find the % for each B, you need to divide 100% by (6 + 1.5*4) = 100% / 12 = (25/3)% or 8.33% (rounded)
To find the % for each A, you need to multiply 8.33% by 1.5 =12.5%
Check: 4 * 12.5% + 6 * 8.33% = 100%

So to find the formula you want:
Let there be n groups with k assigned an A and the other (n-k) assigned a B.

Can you finish it off?
 
Wow, that was much easier than I thought. I was making it more complicated. Thank you for your help.

A=(100/((k*1.5)+(n-k)))*1.5
B=100/((k*1.5)+(n-k))

I am doing this in excel so I will just use an IF = A or B
 
Top