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

Author Message
timknoop
Newbie

Joined: 29 Jun 2011
Posts: 3

 Posted: Wed Jun 29, 2011 10:05 am    Post subject: can OO calc make this formula? i am new to Calc or any spreadsheet system. i want to create a formula (since i cannot find it in the existing lists) that does this: if (A1) is greater than (B1) return "over", if (B1) is greater than (A1) return "under", if equal, return "--" or "=" can this be done and how do i do it?
Ed
Super User

Joined: 28 May 2003
Posts: 1041

Posted: Wed Jun 29, 2011 10:18 am    Post subject:

You could use the IF function. The structure is IF(test ; what to return if true ; what to return if false). The what to return if true and/or what to return if false can be another IF function. If you want to return text rather than a formatted number of the result of a formula, the text should be in quotation marks.

Here you could use something like
 Code: =IF(A1>B1;"over";IF(A1

Hope this helps.
keme
Moderator

Joined: 30 Aug 2004
Posts: 2910
Location: Egersund, Norway

 Posted: Wed Jun 29, 2011 12:12 pm    Post subject: You could also use formatting for the display, and have numeric content in the cell. Formula =A1-B1 Format code: "Over";"Under";"--" The cell will then contain the actual difference, which can be used in further calculations, but will display the text indicating "direction" of the difference only. If this is useful, also see if you can make use of the SIGN() function. (See explanation in the help system.)
timknoop
Newbie

Joined: 29 Jun 2011
Posts: 3

 Posted: Thu Jun 30, 2011 5:38 am    Post subject: can OO calc make this formula? Ed, very helpful. thank you.
 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