simple IF statement help

jjmcnace

New Member
Joined
Jan 25, 2004
Messages
5
I am pretty new to excel. Here is my problem. I use this IF statement in my spreadsheet.

=IF((Y11-Y9)>0,"(90*PI/180)-ARCTAN((Z11-Z9)/Y11-Y9))","(270*PI/180)-ARCTAN((Z11-Z9)/Y11-Y9))")


I want the calculated number to show up, instead of the (90*PI/180)-ARCTAN((Z11-Z9)/Y11-Y9)) to show up.

What can I do to get this to work?
 

Some videos you may like

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

Zack Barresse

MrExcel MVP
Joined
Dec 9, 2003
Messages
10,881
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
  2. Mobile
  3. Web
=IF((Y11-Y9)>0,(90*PI/180)-ARCTAN((Z11-Z9)/Y11-Y9)),(270*PI/180)-ARCTAN((Z11-Z9)/Y11-Y9)))
 

jjmcnace

New Member
Joined
Jan 25, 2004
Messages
5
the quotes is something that excel puts in itself. the actual phrase(90*PI/180)-ARCTAN((Z11-Z9)/Y11-Y9)) shows up instead of calculating the answer to the phrase.
 
L

Legacy 21301

Guest

ADVERTISEMENT

jjmcnace said:
the quotes is something that excel puts in itself. the actual phrase(90*PI/180)-ARCTAN((Z11-Z9)/Y11-Y9)) shows up instead of calculating the answer to the phrase.

That's because the quotes are there.

(Is ARCTAN a native XL function?)
 

Todd Bardoni

Well-known Member
Joined
Aug 29, 2002
Messages
3,042

ADVERTISEMENT

So if ATAN is the function, why are you using ARCTAN? And is ARCTAN an XL function...I couldn't find it.
 

jjmcnace

New Member
Joined
Jan 25, 2004
Messages
5
i'm using ATAN, this is what shows up in the formula bar. I'm not putting the " in the formula excel is doing this.

=IF((Y11-Y9)>0,"(90*PI/180)-ATAN((Z11-Z9)/Y11-Y9))","(270*PI/180)-ATAN((Z11-Z9)/Y11-Y9))")

For example in the cell I'm trying to program Y11-Y9>0 is a true statement, so I want the answer to the formula (90*PI/180)-ATAN((Z11-Z9)/Y11-Y9)) appied to the cell, not the text of the formula itself to show up.

How can I keep excel from inserting the " or is this even the problem.
 
L

Legacy 21301

Guest
jjmcnace said:
i'm using ATAN, this is what shows up in the formula bar. I'm not putting the " in the formula excel is doing this.

=IF((Y11-Y9)>0,"(90*PI/180)-ATAN((Z11-Z9)/Y11-Y9))","(270*PI/180)-ATAN((Z11-Z9)/Y11-Y9))")

For example in the cell I'm trying to program Y11-Y9>0 is a true statement, so I want the answer to the formula (90*PI/180)-ATAN((Z11-Z9)/Y11-Y9)) appied to the cell, not the text of the formula itself to show up.

How can I keep excel from inserting the " or is this even the problem.

Your syntax for the PI function is not correct.

Have a look at XL Help.
It should be PI() instead of PI
 

PaddyD

MrExcel MVP
Joined
May 1, 2002
Messages
14,234
"Your syntax for the PI function is not correct."

...& cos it's not correct, excel assumes you're trying to enter a text string ('cos it can't be a formula - it's not syntactically correct), hence the quotes...
 

Watch MrExcel Video

Forum statistics

Threads
1,123,307
Messages
5,600,869
Members
414,411
Latest member
Snowmanaus

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top