[Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register]

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
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)
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!
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First
 All times are GMT - 8 Hours Page 1 of 1

 Jump to: Select a forum OpenOffice.org Forums----------------Setup and TroubleshootingOpenOffice.org WriterOpenOffice.org CalcOpenOffice.org ImpressOpenOffice.org DrawOpenOffice.org MathOpenOffice.org BaseOpenOffice.org Macros and APIOpenOffice.org Code Snippets Community Forums----------------General DiscussionSite Feedback
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