Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
LAybar
 
Posts: n/a
Default using if statements

I am trying to use this if statement:
IF((J8*J25-J10*J25)<=0,"0",IF(J8*J25-J10*J250,"J8*J25-J10*J25")), the
problem is I can not figure out how to tell it if the answer is greater than
0, put in the number and not J8*J25-J10*J25, can anyone help?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Chip Pearson
 
Posts: n/a
Default using if statements

Remove the quotes form the ELSE argument.

=IF((J8*J25-J10*J25)<=0,"0",IF(J8*J25-J10*J250,J8*J25-J10*J25))


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"LAybar" wrote in message
...
I am trying to use this if statement:
IF((J8*J25-J10*J25)<=0,"0",IF(J8*J25-J10*J250,"J8*J25-J10*J25")),
the
problem is I can not figure out how to tell it if the answer is
greater than
0, put in the number and not J8*J25-J10*J25, can anyone help?



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
LAybar
 
Posts: n/a
Default using if statements

Chip,
Thank you, I have been staring at this for so long, I just could not see
what the problem was!!!

"Chip Pearson" wrote:

Remove the quotes form the ELSE argument.

=IF((J8*J25-J10*J25)<=0,"0",IF(J8*J25-J10*J250,J8*J25-J10*J25))


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"LAybar" wrote in message
...
I am trying to use this if statement:
IF((J8*J25-J10*J25)<=0,"0",IF(J8*J25-J10*J250,"J8*J25-J10*J25")),
the
problem is I can not figure out how to tell it if the answer is
greater than
0, put in the number and not J8*J25-J10*J25, can anyone help?




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bernard Liengme
 
Posts: n/a
Default using if statements

=IF((J8*J25-J10*J25)<=0, 0, (J8*J25-J10*J25))
Syntax of IF: IF(test, result_when_test_TRUE, result_when_test_FALSE)

Your formula could be simplified to
=IF((J8-J10)*J25<=0, 0, (J8-J10)*J25)

Also you could abandon IF and use
(J8-J10)*J25)*((J8-J10)*J25)0)
The Boolean expression (J8-J10)*J25)0 will evaluate to TRUE or FALSE which,
when part of an arithmetic expression, are treated as 1 and 0, respectively.

best wishes
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"LAybar" wrote in message
...
I am trying to use this if statement:
IF((J8*J25-J10*J25)<=0,"0",IF(J8*J25-J10*J250,"J8*J25-J10*J25")), the
problem is I can not figure out how to tell it if the answer is greater
than
0, put in the number and not J8*J25-J10*J25, can anyone help?



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Visblr
 
Posts: n/a
Default using if statements

By putting text between ", the output willbe exactly as typed. remove the "
and you will get the result. so try :

IF((J8*J25-J10*J25)<=0,"0",IF(J8*J25-J10*J250,J8*J25-J10*J25))



"LAybar" wrote:

I am trying to use this if statement:
IF((J8*J25-J10*J25)<=0,"0",IF(J8*J25-J10*J250,"J8*J25-J10*J25")), the
problem is I can not figure out how to tell it if the answer is greater than
0, put in the number and not J8*J25-J10*J25, can anyone help?



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
UDFunctions and nested If-the-else statements JDB Excel Worksheet Functions 1 January 25th 06 03:29 PM
"IF Statements in Microsoft Excel Kathy Excel Discussion (Misc queries) 5 December 5th 05 05:02 PM
Linking two IF statements together trixma Excel Discussion (Misc queries) 2 September 29th 05 06:07 AM
Better Way to Code IF Statements? TheRobsterUK Excel Discussion (Misc queries) 4 July 18th 05 03:37 PM
Nested IF statements John Simons Excel Worksheet Functions 14 February 16th 05 06:17 AM


All times are GMT +1. The time now is 04:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"