Forum Discussion
Peppearson
3 years agoHelper I
Question Re Math Behind Conditional Formatting Rules
Hi I'm trying to understand the maths behind the cell elements condtinal formatting rules see below This has colour codes my values in the following way: 509 - Green 397 - Green 353 - Yellow 2...
- 3 years ago
Hi Peppearson
My understanding is that percentages (in this dialog box) correspond to linear interpolations between the Min and Max values.
So the Value corresponding to a given percentage p is Min + p/100 * (Max - Min).
To put it the calculation in steps, using your figures as an example:
- Take Min = 80
- Take Max = 509
- Calculate Range = Max - Min = 509 - 80 = 429
- Then for any percentage p, the value V is:
V = 80 + p/100 * 429 - So your values for each percentage are:
- V(0%) = 80 + 0/100 * 429 = 80
- V(33%) = 80 + 33/100 * 429 = 221.57
- V(67%) = 80 + 67/100 * 429 = 367.43
- V(100%) = 80 + 100/100 * 429 = 509
The icons are then explained based on where the values fall relative to these threshold values.
It might have been more intuitive if there was an option for percentiles, so that the smallest 33% of values could be given a certain format, and so on. You could still achieve this, but would need to write a measure to handle it.
Regards
Peppearson
3 years agoHelper I
Thanks for the explanation! Makes sense now.