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

Discuss the spreadsheet application

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

Postby avd » Mon Jul 25, 2011 11:52 pm

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

Postby FJCC » Tue Jul 26, 2011 2:29 am

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 be
Code: 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.0 on MS Windows XP ( before 2013-08-03) or Windows 7
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
FJCC
Moderator
 
Posts: 3674
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: If/then statements with word and number values

Postby avd » Wed Jul 27, 2011 9:45 pm

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

Postby avd » Tue Aug 02, 2011 9:43 pm

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

Postby markshah2 » Thu Nov 24, 2011 5:56 am

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


Return to Calc

Who is online

Users browsing this forum: No registered users and 8 guests