EXCEL help please - Scoring for Conditional Numeric Ranges
Discussion
Hi All,
I'm trying to do some customer analysis and would like to set up the following to return a formula driven answer:
If Gross Profit is <1% then score 1
If Gross Profit is >1% but <1.5% score 2
If Gross Profit is >1.5% but <2% score 3 etc.. all up to a max score of 10.
I have a few thoughts on how I could achieve it but it would be pretty clunky by braking it in to several distinct steps (something along the lines of between or min / max = true, if true then score etc), but there must be a better way to achieve it.
Any help appreciated!
I'm trying to do some customer analysis and would like to set up the following to return a formula driven answer:
If Gross Profit is <1% then score 1
If Gross Profit is >1% but <1.5% score 2
If Gross Profit is >1.5% but <2% score 3 etc.. all up to a max score of 10.
I have a few thoughts on how I could achieve it but it would be pretty clunky by braking it in to several distinct steps (something along the lines of between or min / max = true, if true then score etc), but there must be a better way to achieve it.
Any help appreciated!
IF Statements would be very clunky. Also limited to 7 IFs unless Excel 2016 which has IFS Function (not used myself)
You could use Ceiling so the value is rounded up to the nearest 0.5
=CEILING(A2,0.5) where A2 is the Profit %
Then have a Vlookup to return the Score.
Profit Roundup Score
0.5 ----------------------1
1 ------------------------ 1
1.5 ----------------------2
2 ------------------------ 2
2.5 ----------------------3
Note
This will only work if 1 Point is for less than or equal to 1%
You will also need to handle negatives, zeros and above 10 Points.
Could do that with a couple of IFs
You could use Ceiling so the value is rounded up to the nearest 0.5
=CEILING(A2,0.5) where A2 is the Profit %
Then have a Vlookup to return the Score.
Profit Roundup Score
0.5 ----------------------1
1 ------------------------ 1
1.5 ----------------------2
2 ------------------------ 2
2.5 ----------------------3
Note
This will only work if 1 Point is for less than or equal to 1%
You will also need to handle negatives, zeros and above 10 Points.
Could do that with a couple of IFs
Edited by imck on Thursday 31st May 20:31
Thanks All,
I think I will run with a between based approach and just lay the scenarios across the page (I'll do it in steps instead of trying a super complicated formula...)
https://www.myonlinetraininghub.com/excel-between-...
The working sheet wont be the prettiest I'll just hide it anyway!
I think I will run with a between based approach and just lay the scenarios across the page (I'll do it in steps instead of trying a super complicated formula...)
https://www.myonlinetraininghub.com/excel-between-...
The working sheet wont be the prettiest I'll just hide it anyway!
HughiusMaximus said:
Thanks All,
I think I will run with a between based approach and just lay the scenarios across the page (I'll do it in steps instead of trying a super complicated formula...)
https://www.myonlinetraininghub.com/excel-between-...
The working sheet wont be the prettiest I'll just hide it anyway!
What ? Have you not tried my suggestion - or do you not understand it ? It's very straightforward. And whatever you do, you need to specify what happens if Gross Profit = 1% or 1.5% or 2% or ...I think I will run with a between based approach and just lay the scenarios across the page (I'll do it in steps instead of trying a super complicated formula...)
https://www.myonlinetraininghub.com/excel-between-...
The working sheet wont be the prettiest I'll just hide it anyway!
HughiusMaximus said:
Hi All,
I'm trying to do some customer analysis and would like to set up the following to return a formula driven answer:
If Gross Profit is <1% then score 1
If Gross Profit is >1% but <1.5% score 2
If Gross Profit is >1.5% but <2% score 3 etc.. all up to a max score of 10.
I have a few thoughts on how I could achieve it but it would be pretty clunky by braking it in to several distinct steps (something along the lines of between or min / max = true, if true then score etc), but there must be a better way to achieve it.
Any help appreciated!
Can you let us know what you're ultimately trying to achieve, as that is likely to produce the best method. I can't see what purpose you would use outputs of 1 through 10 for in relation to categories of GP.I'm trying to do some customer analysis and would like to set up the following to return a formula driven answer:
If Gross Profit is <1% then score 1
If Gross Profit is >1% but <1.5% score 2
If Gross Profit is >1.5% but <2% score 3 etc.. all up to a max score of 10.
I have a few thoughts on how I could achieve it but it would be pretty clunky by braking it in to several distinct steps (something along the lines of between or min / max = true, if true then score etc), but there must be a better way to achieve it.
Any help appreciated!
For example, do you want to place all those with Gross Profit lower than x% on credit watch, or using GP to derive buy/sell/hold or similar output?
Also, what happens if GP is <1% or >10%?
mike_knott said:
As imck said, if you have a suitable version of Excel, use the IFS function:
=IFS(GrossProfit<1%,1,GrossProfit<1.5%,2,GrossProfit<2%,3,etc...)
You can use 127 conditions.
Otherwise, use a lookup.
Mike...
Awful advice. Why make it so complicated when it can be so simple ?=IFS(GrossProfit<1%,1,GrossProfit<1.5%,2,GrossProfit<2%,3,etc...)
You can use 127 conditions.
Otherwise, use a lookup.
Mike...
Let's say your Gross Profit figure is in cell A1 (or wherever). In cell B1 put "=if(A1<1,1,RoundDown(2*A1,0))"
If you have A1 formatted as %, then the formula becomes "=if(A1<0.01,1,RoundDown(200*A1,0))"
Without the quote marks of course. Now vary the value in A1 and see what happens in B1.
No need for multiple conditions, or hidden fields. Please at least just try it.
You still haven't defined what happens when GrossProfit = 1 or 1.5 or 2 or ...
gothatway said:
Awful advice. Why make it so complicated when it can be so simple ?
It answers the question as stated. Yours works, but it assumes that the gross profit and scores increase in the same way and doesn't get the right answer if the score increases when the gross profit equals the multiple of 0.5. As you and others have pointed out, we do not know this is the case.Yours also means that for somebody to understand the calculation they need to understand the Excel function as well as the underlying maths. With IFS, they only need to understand the function, which they can see from the help file.
IFS is also easily extended for further conditions which do not follow a pattern, by adding them to the list.
Mike...
Gassing Station | Computers, Gadgets & Stuff | Top of Page | What's New | My Stuff


