using if statements

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to use this if statement:
IF((J8*J25-J10*J25)<=0,"0",IF(J8*J25-J10*J25>0,"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?
 
Remove the quotes form the ELSE argument.

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


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
Chip,
Thank you, I have been staring at this for so long, I just could not see
what the problem was!!!
 
=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
 
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*J25>0,J8*J25-J10*J25))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top