Excel help
 

MegaSack DRAW - This year's winner is user - rgwb
We will be in touch

[Closed] Excel help

12 Posts
7 Users
0 Reactions
107 Views
Posts: 0
Free Member
Topic starter
 

im trying to set up a scoring system in excel where it scores a % achieved.
ive worked out all my percentages, I want to score them 1 - 5 as follows.

less than -5% = 1
between -5% & 0% = 2
0% to 10% = 3
10% to 20% = 4
greater than 25% = 5

im sure its really simple, been playing around for a good hour or so with no luck!


 
Posted : 29/10/2014 4:27 pm
Posts: 36
Free Member
 

Nested if statements using < and > will do it


 
Posted : 29/10/2014 4:28 pm
Posts: 0
Free Member
Topic starter
 

been trying 'ifs' but couldn't get them to work, I can do simple if's but skill are clearly lacking!


 
Posted : 29/10/2014 4:30 pm
Posts: 0
Free Member
 

something like

=if(source < -0.5,1,=if(source <= 0, 2, if (source <=0.1, 3, if (source <= 0.2, 4, 5 ))))

(assuming your 5 score is for > 20% not 25% otherwise you have a no score region between 20 and 25%)


 
Posted : 29/10/2014 4:31 pm
Posts: 0
Free Member
Topic starter
 

yeh 20% not 25%
didn't know you could do multiple if's like that

off to have a play!


 
Posted : 29/10/2014 4:34 pm
Posts: 0
Free Member
Topic starter
 

sorted, thanks allthepies!


 
Posted : 29/10/2014 4:45 pm
Posts: 0
Free Member
 

no probs 🙂


 
Posted : 29/10/2014 4:51 pm
Posts: 71
Free Member
 

didn't know you could do multiple if's like that

Aye, that's the nested part of nested ifs, you can only do about 7 unless you make it more complex, but by then a formula is insanely long anyway, and a macro probably makes more sense!


 
Posted : 29/10/2014 5:52 pm
Posts: 7869
Full Member
 

Or you could solve that scenario of to many categories using a lookup function with the final variable set to true and a carefully constructed lookup table. For those of us what don't do vba it is a handy fix.


 
Posted : 29/10/2014 8:31 pm
Posts: 3660
Full Member
 

you can only do about 7 unless you make it more complex, but by then a formula is insanely long anyway,

I think the limit was removed in Excel 2007. It's still there but it's something like 128 nested ifs rather than 7. Nested ifs are probably the quickest and easiest way to deal with the OP's problem.


 
Posted : 29/10/2014 9:08 pm
Posts: 71
Free Member
 

Still there in 2007, I've reached it, and it's what we use at work! I absolutely agree, and I use them because I'm shit at VBA, was merely observing it all gets a bit complex if you're not careful!


 
Posted : 29/10/2014 9:33 pm
Posts: 7869
Full Member
 

Njee my method would work for you.

It's too late at night to spell it out in detail but in essence you put the upper or lower end of the banding (I always end up doing this by trial and error as I can never recall whether lookup goes up or down on imprecise matches) in the first column of a lookup table and then your group/category in the next column then use the imprecise version of vlookup to look the % up in the table and return the category.

Nesting lots of if functions carries risk of zigging where you should zag so I tend to use this approach where I would need to use more than 4 nested functions


 
Posted : 29/10/2014 10:13 pm
Posts: 1
Free Member
 

is this not a case where a vba function would be a hell of a lot simpler than loads of convolution nested ifs (are you missing a score for a percentage between 20 and 25?)

something like

Dim score as integer

Select Case p
Case Is < -5
score = 1
Case Is < 0
score = 2
Case Is < 10
score = 3
Case Is < 20
score = 4
Case Is > 25
score = 5
Case Else
score = 0
End Select

This is one step away from 'hello world'


 
Posted : 29/10/2014 10:26 pm