# Multiple criteria in one formul

#### Belinda Payroll

##### New Member
Hi,

I am trying to do the following:

IF D20 is less than zero, return D17
OR IF D20 is greater than zero, return value of D17 minus D20
OR IF D20 is greater than zero and D20 is greater than D17, return zero

This is the formula that I created: =+IF(D20<=0,D17,IF(D20>=0,D17-D20,IF(D20>=0,D20>D17,0)))

The 1st 2 criteria are working correctly but I cannot get the 3rd one to work. Can someone please help me.
Thanks Belinda.

### Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.

#### VoG

##### Legend
Try

=IF(D20<0,D17,IF(AND(D20>0,D20>D17),0,D17-D20))

#### Belinda Payroll

##### New Member
(SOLVED) Multiple criteria in one formul

Thank you. The formula you provided worked exactly as it should. This query is now resolved.

Replies
3
Views
56
Replies
4
Views
76
Replies
9
Views
42
Replies
0
Views
53
Replies
1
Views
69