## [Solved] If/then statements with word and number values

### [Solved] If/then statements with word and number values

Hello all.

I want to make an if/then statement that works with words and with numbers.

For example:
if b = coupon rate[number], then, bond sells at par value[words]
if b > coupon rate[number], then, bond sells at discount[words]
if b < coupon rate[number], then, bond sells at premium[words]

I have searched for a while and have yet to find how to perform such functions.

Help if you can.

Thanks,

-avd
Last edited by Hagar Delest on Tue Aug 02, 2011 10:51 pm, edited 1 time in total.
Reason: tagged [Solved].
OpenOffice 3.2
Ubuntu 10.04 lucid
avd

Posts: 3
Joined: Mon Jul 25, 2011 11:41 pm

### Re: Calc: if/then statements with word and number values

The basic form of the statement is (assuming the value of b is stored in cell B1 and the coupon rate is stored in C1)
Code: Select all   Expand viewCollapse view
`IF(B1 = C1;"The bond sells at par value";"The bond sells at a price other than par value")`

I added the "other than par value" part because the structure of the IF() statement is usually IF(This Is True; Do This; Otherwise Do This)
Your three conditions can be done in a single formula
Code: Select all   Expand viewCollapse view
`IF(B1=C1;"The bond sells at par value";IF(B1>C1;"The bond sells at a discount";IF(B1<C1;"The bond sells at a premium")))`

The three IF() are nested so each successive IF() serves as the "Otherwise Do This" clause of the previous IF()
 Edit: After sitting down to dinner I realized that there is no need for three nested IF's. If the first two are false, then the last condition has to be true. The formula can beCode: Select all   Expand viewCollapse view`IF(B1=C1;"The bond sells at par value";IF(B1>C1;"The bond sells at a discount";"The bond sells at a premium"))`
AOO 3.4 or 4.1 on MS Windows XP ( before 2013-08-03) or Windows 7
FJCC
Moderator

Posts: 4955
Joined: Sat Nov 08, 2008 8:08 pm

### Re: If/then statements with word and number values

Thanks. I'll plug it in and see what happens.
OpenOffice 3.2
Ubuntu 10.04 lucid
avd

Posts: 3
Joined: Mon Jul 25, 2011 11:41 pm

### Re: If/then statements with word and number values

FJCC,

Thanks for the help. It worked perfectly.

-AVD
OpenOffice 3.2
Ubuntu 10.04 lucid
avd

Posts: 3
Joined: Mon Jul 25, 2011 11:41 pm

### Re: [Solved] If/then statements with word and number values

Language is very technical .I tried to understand it but i think i need to consult with someone who can understand verbally.
OpenOffice 3.1 on Windows 7 dubai shopping | dubai deals | cobone dubai | cobone
markshah2

Posts: 2
Joined: Thu Nov 24, 2011 5:00 am