Multiple IF function


Posted by Sasa on January 30, 2002 6:41 AM

Dear all,
I have formula =IF($K$2>10,IF($K$2<20,"*"),"")wich works, but I would like to add one more condition something like =IF($K$2>20,"**"). How can I combine this two formula into one?
Thanks in advance.
Regards
Sasa

Posted by Aladin Akyurek on January 30, 2002 7:00 AM

Sasa --

You can better describe condtion by condition what you want to compute/achive like this

K2 > 10 and K2 < 20 ----> *
etc

Care to do that?

Aladin

=======

Posted by JohnG on January 30, 2002 7:12 AM

Try
=IF($K$2>10,IF($K$2<20,"*","**"),"")
If its less than 20 you get "*" else if its equal or greater than 20 you get "**"

Posted by Mark W. on January 30, 2002 7:41 AM

Another approach...

You could skip the IFs and use...

=REPT("*",MIN(2,MAX(0,$K$2)/10))

...later if you decide to add an asterisk for
each increment of 10 you could change it to...

=REPT("*",MAX(0,$K$2)/10)

...which is much simplier than nesting IFs!

Posted by Sasa on January 30, 2002 7:42 AM

Thank a lot. Works fine :)))



Posted by Sasa on January 30, 2002 8:06 AM

Re: Another approach...

Thanks. Works even better !!!
Really appreciate it :)