View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JLatham JLatham is offline
external usenet poster
 
Posts: 3,365
Default Case selection in Excel 2003

You could look at the CHOOSE() function for the worksheet, but I think the
numbers are going to be out of range for you.

Typically this is done with a table and a VLOOKUP() function in a cell.

You'd have a table somewhere set up like this:
C D
1 10 "Branch 10 Information"
2 20 "Branch 20 Information"
....
15 150 "Branch 150 Info"

Now you enter the branch you want into a cell, say A1 and somewhere you have
a VLOOKUP() formula like this:
=VLOOKUP($A$1,$C$1:$D$15,2,FALSE)
The table can even be on another sheet, you just have to add the sheet name
to the formula where it references the table's range.

That will return a #N/A error when there's no match (as when A1 is empty),
so you can wrap it in an 'error trap' like this:
=IF(ISNA(=VLOOKUP($A$1,$C$1:$D$15,2,FALSE)),"",=VL OOKUP($A$1,$C$1:$D$15,2,FALSE))
which will either show you the value from column D when a match is found in
column C to the entry in A1 or it will just look empty when there isn't a
match.

Hope this helps some.


"m2work" wrote:

I am working on a form that can be used for 15 different branches.'

If I type branch "10", info for branch 10 will display.
If I type branch "20", info for branch 20 will display.

I can do nested "if" statements, but I can only do up to 7 nested
statements, not for 15.

Is there a way to accomplish this? Any help is greatly appreciated.

Thanks,
m2