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

Discuss the spreadsheet application
Post Reply
avd
Posts: 3
Joined: Mon Jul 25, 2011 11:41 pm

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

Post by avd »

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
FJCC
Moderator
Posts: 9248
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

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

Post by FJCC »

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

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

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 be

Code: Select all

IF(B1=C1;"The bond sells at par value";IF(B1>C1;"The bond sells at a discount";"The bond sells at a premium"))
 
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
avd
Posts: 3
Joined: Mon Jul 25, 2011 11:41 pm

Re: If/then statements with word and number values

Post by avd »

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

Post by avd »

FJCC,

Thanks for the help. It worked perfectly.

-AVD
OpenOffice 3.2
Ubuntu 10.04 lucid
markshah2
Posts: 2
Joined: Thu Nov 24, 2011 5:00 am

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

Post by markshah2 »

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
Post Reply