Anvil Community Forum

Maths Help Wanted

I’m having a wood/trees moment…

I have a target of (say) 5,000, noting this may vary.
I also have 24 values between 0 and 10, let’s call them v1 to v10. These values are meant to be relative to each other.

I need to work out what percentage of the target each of the 24 values represents.

For example, if all the values were the same, then each would represent 4.1666…% of the total, no matter what the literal values were (meaning they could all be 1 or all be 7 or whatever).

I was thinking …
if I add all 24 values together, that would be the 100% value (HPV).
I then do this for each : percentage = (v / HPV) * 100
Then each row would have a value like this : absolute_value = (target / 100) * percentage

That seems to work in my head - does it make sense?

Yep, that’s right, if I understand what you’re wanting.

1 Like

Thank you sir!

Unfortunately, I clicked “like” before marking you as an answer, and now the answer check box doesn’t show.

It’s cause this thread is in Feature Requests. If you move it to Q&A, the solution box will appear

1 Like


But … I’ve moved it and it still isn’t there.

edit - it reappeared after I clicked the spanner icon. Fitting, given my previous mistake :slight_smile:

1 Like