OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

(solved) How to write the IF formula with multiple results?

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc
View previous topic :: View next topic  
Author Message
Sithlyone
Power User
Power User


Joined: 13 Jan 2012
Posts: 98

PostPosted: Wed May 30, 2012 11:04 am    Post subject: (solved) How to write the IF formula with multiple results? Reply with quote

Is there a way to write an "If" formula for multiple possibilities?

My issue is that I have 10 possible numbers that can be entered into a cell and I want to have the cell next to it to have another number based off of the random number.

For example:

my random numbers will be generated in cells: b2-b7

My result numbers will be in cells: c2-c7

Obviously B2 would match up with c2 and so on.

My results would be as follows:

If the random number is:

8 the result would be: -1
9 the result would be: -1
10 the result would be: 0
11 the result would be: 0
12 the result would be: 1
13 the result would be: 1
14 the result would be: 2
15 the result would be: 2
16 the result would be: 3
17 the result would be: 3
18 the result would be: 4

I'm sorry if this is confusing, please let me know if you need anymore info. Thank you for looking any help you can give me.
_________________
I'm just a Newb trying to learn. Please don't assume I know what I am doing. Thanks for the help!


Last edited by Sithlyone on Wed May 30, 2012 12:08 pm; edited 1 time in total
Back to top
View user's profile Send private message
Ed
Super User
Super User


Joined: 28 May 2003
Posts: 1041

PostPosted: Wed May 30, 2012 11:40 am    Post subject: Reply with quote

Is there any reason you have to use the "IF" function?

I notice the number on the right is always (half the number on the left) minus five, rounded down to the nearest integer. Why not calculate them as such instead of a complicated multiple IF formula?

=INT(B2/2-5)

should do perfectly well.
Back to top
View user's profile Send private message
Sithlyone
Power User
Power User


Joined: 13 Jan 2012
Posts: 98

PostPosted: Wed May 30, 2012 12:08 pm    Post subject: Reply with quote

There you have it. Thanks so much, I knew there were much smarter people than I here!

Thanks Ed
_________________
I'm just a Newb trying to learn. Please don't assume I know what I am doing. Thanks for the help!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
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