# If < 0 Then

#### vessii80

##### New Member
Hi everyone,
I need help from you.
I have following:

B3 5
B4 23

and below

B10 20

I want to write a formula in C 3 saying:
If (B5-B10)>0 the real result ,If (B5-B10)=<0 then showing 0, and in C 4 showing the result of B4 minus the rest.
So in this example we have:
1. B5-B10=-15, so in C3 we must have 0 and in C 4=8, B4-(-(B5-B10))

Iva

### Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

#### Richard Schollar

##### MrExcel MVP
Hi & Welcome to the Board

For the first part (I didn't understand what you were asking for the second) you could use:

=MAX(0,B5-B10)

#### vessii80

##### New Member
Hi,
And thank you for the reply.

I'll try to explain:

If the result If (B5-B10)>0 in C 3 to be shown the positive result, if it's negative to show zero

regards,

Iva

#### Richard Schollar

##### MrExcel MVP
Yes, that is handled by the formula I have already given you. it was the what you wanted next I didn't understand.

#### vessii80

##### New Member
The next part is:

If the result is negative to take the value from B4 and and extract the negative result from it, showing it in C 4

#### Richard Schollar

##### MrExcel MVP
Perhaps:

=IF(B5-B10<0,B4+B5-B10,"")

in C4.

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

1,168,184
Messages
5,857,830
Members
431,900
Latest member

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