# If problem

#### rwhalls

##### New Member
The formula below can produce two results. I need a third. If M17_R17 is greater than R17 the result should be 1.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>

Thanks

=IF(OR((M17+R17)=N17,(M17+R17)<N17),0,-1)<o></o>

Last edited:

### Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.

#### T. Valko

##### Well-known Member
The formula below can produce two results. I need a third. If M17-R17 is greater than R17 the result should be 1.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>

Thanks

=IF(OR((M17+R17)=N17,(M17+R17)<N17),0,-1)< font>

In its posted form Excel will not accept that as a formula.

If you make it syntactically correct, then the possible results are either M17+R17 or FALSE.

So, if you want to add another condition which of the conditions should take precedence? M17+R17=N17 or M17-R17 is greater than R17 ?

#### rwhalls

##### New Member
In the following formula when (M17+R17)<N17 it should produce -1. It produces 0.<N17 b 0.< a It -1. should produces produce it>
<N17 b 0.< a producing is It -1. be should><?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
<o></o>

=IF(AND((M17+R17)<>N17,(M17+R17)>=N17),1,IF(OR((M17+R17)=N17,(M17+R17)<N17),0,-1)) <o></o>

Last edited:

#### rwhalls

##### New Member
In the following formula when (M17+R17)<N17 should be -1. It is producing a 0.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
<o> </o>
=IF(AND((M17+R17)<>N17,(M17+R17)>=N17),1,IF(OR((M17+R17)=N17,(M17+R17)<N17),0,-1)) <o></o>

Replies
14
Views
200
Replies
3
Views
219
Replies
3
Views
113
Replies
4
Views
363
Replies
4
Views
189

1,191,609
Messages
5,987,651
Members
440,105
Latest member
thigarette

### 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.

### Which adblocker are you using?

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

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