Alternative to IF function

M

mms

I have a formula that is using nested IFs, and it is beginning to becom
unmanageable.

First I am at the 7-deep limit, but otherwise I find the logic aspec
hard to follow everytime I have to alter it.

In VB there is *Select Case*, in C++ there is *switch*.

Is there a VB *worksheet* function with similar functionality t
these?
(I've searched but can't find).

something like:

Code
 
D

daniels012

As far as I know there is not a function to do these. However you ca
do it through a macro. When you create a macro go to help and you wil
find both CASE and SWITCH as a funtion.

Hope this helps!
Michae
 
B

Bob Phillips

Something like =CHOOSE(MATCH(A1,{"A-325","A-490","A-500"},0),"Option
1","Option 2","Option3")

It might be best to put {"A-325","A-490","A-500"} values in a table.
Or you could use

=VLOOKUP(A1,B1:C10,2,FAlse)

Where B1=A-325, B2=A-450, etc, C1=Option 1,C2=Option 2, etc.

--

HTH

RP
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top