| View previous topic :: View next topic |
| Author |
Message |
zeratulcraft Newbie

Joined: 05 Mar 2008 Posts: 2
|
Posted: Wed Mar 05, 2008 4:20 am Post subject: Fun Complex Code Question |
|
|
Hi
I have a random number function ( =RANDBETWEEN(1;55)) and 1;49. This is working fine, but I want a second piece of code to look at the number, and based on the result, out put the appropriate piece of information.
Example;
Value is 12, Code sees 12, goes across to column 12 and sees "Apple" so it prints Apple in the cell. Or the value is 35, Code sees 35, goes across to column 35 and sees "Banana" so it prints that in the cell instead.
I have no clue how to code such complexities, my code so far can just tell me whether the value is 1, print the appropriate cell, or if it's not 1, and print a second cell's information.
Is there a way to embed multiple layers of IF statements? Any help would be greatly appreciated.
Thank you.
Z |
|
| Back to top |
|
 |
keme Moderator


Joined: 30 Aug 2004 Posts: 2732 Location: Egersund, Norway
|
Posted: Wed Mar 05, 2008 4:45 am Post subject: |
|
|
Assuming the lookup list of words is in row 1, column C to AU, and your random number is in cell A1.
In cell B1, enter =INDEX(C1:AU1;1;A1) |
|
| Back to top |
|
 |
zeratulcraft Newbie

Joined: 05 Mar 2008 Posts: 2
|
Posted: Wed Mar 05, 2008 5:26 am Post subject: |
|
|
Great That does it perfect, thanks so much! |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|