473,412 Members | 2,293 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

nested if statements - is there an alternative

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.

2 2029
Rabbit
12,516 Expert Mod 8TB
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
Thanks Rabbit,

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

thanks again

LG
Sep 1 '11 #3

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

Similar topics

7
by: Matt MC | last post by:
Are there any alternatives to the .php file extension that will call it, such as page.xyz? ....or does that need to be setup at the server administration level, or is this not possible at all?
4
by: Profetas | last post by:
Hi, Nested statements helps to generate complex source code, what is the nesting limit that you normally consider? I know that the Halsted and McCabe analyses can define the acceptable level,...
2
by: Rudolf Ball | last post by:
Hi NG, I want to build two classes, Demo.Car (where Demo is the Namespace) and Demo.Car.Wheel Is the only solution a nested Class? Isn`t there anything more elegant? Thank you
6
by: MARTIN LANNY | last post by:
Is there alternative to AxWebBrowser? I spent one whole week trying to make AxWebBrowser refresh php page. It never works. I tried over 10-15 suggestions from Microsoft itself. Refresh just...
22
by: Technoid | last post by:
Is it possible to have a conditional if structure nested inside a conditional switch structure? switch(freq) { case 1: CASENAME if (variable==1) { do some code }
1
by: Roy | last post by:
Hey all. Below is the nested syntax on how to make a "codeless" nested gridview embedded within another gridviews templatefield column. Only problem is that it loads slow. REAL SLOW. There has to...
8
by: Ragbrai | last post by:
Howdy All, I have a query that is used for filtering results to be used in a combo box. The query needs to test fields from both a table and then unbound text boxes on the form that also contains...
11
by: downwitch | last post by:
Hi, I'm using a 3rd-party app's back end which stores SQL statements in a table, so I have no choice but to use dynamic SQL to call them (unless someone else knows a workaround...) Problem...
3
by: matthewaveryusa | last post by:
Hi, This is a simple question. How do I get statements that are nested (so like an if statement inside an if statement) to have the little +/- button so I can collapse it? thanks, Matt
4
by: henry | last post by:
Folks: Using Dreamweaver CS3... Consider a home page, "index.php" which conditionally REQUIREs one of 'N' HTML files of pure content. All site styles are specified in a master CSS file,...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.