View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Arvi Laanemets Arvi Laanemets is offline
external usenet poster
 
Posts: 510
Default Using SELECT...CASE with comparison operators?

Hi


"Toby Erkson" wrote in message
...
C'mon Tom, it was example code, I was trying to be generic. How could I

have
made it more helpful -- what would you suggestion?

Actually, your code comments were perfect :-) Thanks for the help!

Arvi, I actually have a lot more conditions and resulting statements so

your
example isn't even feasible (which is why I asked for SELECT...CASE),

however,
thanks for the alternative simple solution :-)


Actually, CHOOSE worksheet function can have up to 30 arguments, so you have
29 possible responses there. When there is more of them, then you can wrap
several CHOOSE's into IF(,,), like:
=IF(wigets<20,"",IF(wigets<5800,CHOOSE(....),IF(wi gets<11600,CHOOSE(....),CH
OOSE(...))))
but probably this isn't very good solution.

And then you can have a list of choices on some sheet, and then you can
refer to range - like:
=IF(wigets<20,"",INDEX(Choices!A1:A1000,INT(A1 /200)+1,1))
A bonus with this - user can easily edit the list of choices without any
need for VBA


--
Arvi Laanemets
(Don't use my reply address - it's spam-trap)