# Syntax

#### chaus

##### New Member
This is my first post, please forgive my limited knowledge.
I want to create a formula that:
IF(A1+A2)<=0 à enter 0 in B2
IF(A1+A2)>=1 à enter the sum in B2
I tried: =IF((A1+A2)<=0,0,1) (This was as far as I could get with Excel 2007 Help and my limited knowledge)
It produces the correct result for <=0 but when the sum is >=1 it only produces 1.
Chaus

### Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.

#### dialup

##### Board Regular

try
=IF((A1+A2)<=0,0,A1+A2)

#### Colin Legg

##### MrExcel MVP
Hi Chaus,

What do you want to happen if A1+A2 is in between 0 and 1?

I think you might be looking for this:

=MAX(0,A1+A2)

#### dave3009

##### Well-known Member
Hi chaus

Welcome to the Board

=IF((A1+A2)<=0, 0, A1+A2)

I wasn't sure what you wanted doing when the value was between 0 and 1 so this just provides and answer around the sum being higher or lower than 0

HTH

Dave

#### chaus

##### New Member
Thank you, dialup, Colin L, and dave3009. All of your suggestions worked. Also, your assumptions were correct.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
I was looking for 0 if the sum was <0<o></o>
I was looking for the actual sum if >0<o></o>
<o></o>
Thanks again,<o></o>
Chaus<o></o>

Replies
2
Views
77
Replies
9
Views
118
Replies
2
Views
40
Replies
1
Views
46
Replies
12
Views
333

1,127,204
Messages
5,623,357
Members
415,969
Latest member
Rey99

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