Use a number as a baseline in a percentage?

So basically I am trying to set a number as a baseline (21) out of another number (31) and display it as 1/11. the two both have 10 in difference. One idea is to keep subtracting the 21 and 31 until I get a 1/11, but I feel like there is a more obvious and practical solution. Any ideas?

(I cannot straight up input 1/11 since there are precentages for 31/41, 41/51 and so on)

So you need 21 to be 10% and 31 to be 100%?

Can you explain your problem a bit more?

At the moment I don’t see why you can’t just subtract them both by (numerator - 1).

Please let me know a bit more what you are trying to do.

1 Like

Yes, but not only 21 and 31, the first number will change, and I can keep track of the max number
so it could be
31 and 41 (1/11)
or it could be
35 and 41 (5/11)
and it should scale accordingly

The numbers aren’t always the same but they will follow the …1 to …1 +10 pattern, the problem is the precentage won’t be the same, and I am trying to find a way to transform the two numbers to a normal precentage

To calculate percentage you need 3 values. The first for the base value, the second for the current value and the third for the maximum value. Store the 3 values ​​and you can manipulate them however you want.

yes but I am more worried about a way to convert them to the base…? something like
min current max
31 35 41
converted into:
min current max
1 5 11

my current idea is to just keep subtracting 10 from the max or the min until I get a normal percentage, but I feel like there’s a better solution

Min = 31
Current = 35
Max = 41

Size = (Current - Min) / (Max - Min)

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.