Adapting a percentage value based on input

60 Views Asked by At

I have a program that I need to maintain a certain percentage, between 10-15 percent of subcounts to majorcounts.

Test data:

 Time       subcount    majorcount
 10:20             1            30
 10:30             3            40
 10:40             5            50
 10:50            10           100
 11:20            20           400
 11:40            10           200
#11:50           200           200

        sum(248)      sum(1020)

        perc(248/1020) = 24.31

The last addition is what I am to add to my data if it is within the 10-15% range and it does not take my dataset overall over or under my range.

If it does take my dataset over, How can I identify the amount of subcounts to remove or the majorcounts to add to maintain the 10-15% requirement?

In the case above, I have a 24% that I would need to attempt to drop down to 15 using only the last values added identified by the #.

1

There are 1 best solutions below

0
On BEST ANSWER

you could use markup and margin. $24.31\%$ is $62 {2\over 3}\%$ markup on $15\%$ which means you need to take away at least $$38.52459016\%$$ of the sum of subcounts. to land within the range, and by similar logic you can calculate for no less than $10\%$. or you can just markup the majorcount within the relevant markups calculated. One last option is to mix the two strategies, but honestly, it seems a wasted effort.