Nested If Statements

J

Jasmine

We are trying to create a worksheet where when a user enters a particular
number it puts a different number on the second sheet. Was trying to use
nested If statements to do this. However, we have more than 20 things that
need to be looked at. Is there another way to do this? Thanks!
 
T

tony h

if you can make a table of the values (one column with the value entered
and another with the response to that value) you can use a vlookup. This
can search the first column and return the value in the second.

You will find plenty of advice and examples of vlookup in help and in
previous posts in this forum

Hope this helps you on your way.
 
S

SteveG

Jasmine,

Are your numbers in sequential order? i.e. 1-20 or 20-40? If so yo
can use the CHOOSE function. For example.

If the number is entered into Sheet1!A1 and you want it to produce
number in Sheet2!A1 using the numbers 1-20 as the entered data then i
Sheet2!A1.

=CHOOSE(Sheet1!A1,10,20,30,40,50,60,70,80,90,100)

This will look at Sheet1!A1 as an index number starting at 1.
10,20,30...is the step of the index meaning if the index = 1 then 10 i
populated in
Sheet2!A1 and so on up the line 2=20,3=30. If your range of entere
values begins higher than 1 say 20-40 then.

=CHOOSE(Sheet1!A1-19,200,300,400,500,600,700.......)

Subtracting the 19 makes it recognize 20 as the first step value. Yo
can also incorporate an IF statement to return a blank cell if a valu
entered is not in the range you are looking for.

Does that help?

Stev
 
Top