Pickle Lily
New Member
- Joined
- Feb 28, 2018
- Messages
- 1
I would like to write a formula that assigns a number to a cell value based on a range of numbers. For example, I have a column that calculates 'risk percentage', which I then need to assign to a 'risk ranking' as per the table below:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Risk Ranking[/TD]
[TD]Percentage Range[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]<10%[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]10-20%[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]20-40%[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]40-60%[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]>60%[/TD]
[/TR]
</tbody>[/TABLE]
I have written the following formula: =IF(AND(G22>P13,G22<=Q13),O13,R13), where:
G22 = test value (e.g. risk percentage)
P13 = bottom of percentage range (e.g. 0%)
Q13 = top of percentage range (e.g. 10%)
O13 = result if true (e.g. risk ranking)
R13 = result if false (e.g. -)
I have clumsily spread this out over five columns - one for each percentage range, but is there a way to combine this into one formula / cell?
Many thanks,
[TABLE="width: 500"]
<tbody>[TR]
[TD]Risk Ranking[/TD]
[TD]Percentage Range[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]<10%[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]10-20%[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]20-40%[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]40-60%[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]>60%[/TD]
[/TR]
</tbody>[/TABLE]
I have written the following formula: =IF(AND(G22>P13,G22<=Q13),O13,R13), where:
G22 = test value (e.g. risk percentage)
P13 = bottom of percentage range (e.g. 0%)
Q13 = top of percentage range (e.g. 10%)
O13 = result if true (e.g. risk ranking)
R13 = result if false (e.g. -)
I have clumsily spread this out over five columns - one for each percentage range, but is there a way to combine this into one formula / cell?
Many thanks,