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

Author Message
oblivious
Newbie

Joined: 19 Apr 2009
Posts: 1

 Posted: Sun Apr 19, 2009 11:32 pm    Post subject: if/or I'm trying to figure out how to set up a spreadsheet so that the first cell in a row will assign a value to several of the next cells. I'd like something along the lines of then B1 returns "true" that much I've figured out, the trick is I then want then B1 returns "penguins" t hen B1 returns "elephants" C1 returns "Big" C1 returns "Small" C1 returns "Between" I can't seem to get the syntax right to use the ifs and ors in conjunction with each other. Does anyone know how to do this, or if it is even possible? Also if this could be set up in a format that can be copied to the next row without change (So it applies from A1 to B1/C1 and copies straight to B2/C2 to read from A2 etc) it would be a great help. I know I could do that in excel so I assume it's possible here(I'm brand new to ooo). My thanks in advance.
davidh182

Joined: 01 Apr 2004
Posts: 413

Posted: Mon Apr 20, 2009 1:10 am    Post subject:

Although you can nest if & or, it will get confusing to balance the brackets etc.

A clearer approach is to use a look-up-table like this:
2 penguins
6 penguins
18 penguins
1000 penguins
17 elephants
95 elephants
103 elephants
1200 elephants

0 Small
200 Between
400 Big

In cells G1:H12

You then need the formula in B1:

 Code: =VLOOKUP(A1;G1:H8;2;0)

and in C1

 Code: =VLOOKUP(A1;G10:H12;2)

Note the C1 formula automatically handles greater/less than.
 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