If < 0 Then

vessii80

New Member
Joined
Jun 13, 2008
Messages
3
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))

Thank you in advance.

Iva
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

Richard Schollar

MrExcel MVP
Joined
Apr 19, 2005
Messages
23,707
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
Joined
Jun 13, 2008
Messages
3
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
Joined
Apr 19, 2005
Messages
23,707
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
Joined
Jun 13, 2008
Messages
3
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
 

Watch MrExcel Video

Forum statistics

Threads
1,129,685
Messages
5,637,809
Members
416,983
Latest member
LessThanAverageUser

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Top