By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,708 Members | 2,055 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,708 IT Pros & Developers. It's quick & easy.

nested if statements - is there an alternative

P: 56
Hi all,

I have an excel file with a number of validated lists that contain text; I would like to save a corresponding numerical value in another column when a particular option is picked from the text list.

for example one column uses a list of Teachers names and each teacher has a corresponding numerical value:

Expand|Select|Wrap|Line Numbers
  1.  TeacherName TeacherID 
  2.  TeacherA    11 
  3.  TeacherB    15
  4.  TeacherC    23
I want the user to select TeacherA from the list but in another field have the code 11 be entered. I was using a set of nested if statements to do this which was working but hit a problem once getting to the 7th instance. Is there another way? BTW the numbers are required as the data will ultimately be imported to an access database; the numbers correspond to lookup lists in the database.

thanks
LG
Aug 26 '11 #1

✓ answered by Rabbit

Store all the teachers and their id in another sheet. Then use a lookup function to get the id instead of hardcoding it into the function. That way you can add/delete teachers without having to update the formula.

Share this Question
Share on Google+
2 Replies


Rabbit
Expert Mod 10K+
P: 12,369
Store all the teachers and their id in another sheet. Then use a lookup function to get the id instead of hardcoding it into the function. That way you can add/delete teachers without having to update the formula.
Aug 26 '11 #2

P: 56
Thanks Rabbit,

I used the vlookup function to get the result I wanted.

thanks again

LG
Sep 1 '11 #3

Post your reply

Sign in to post your reply or Sign up for a free account.