Logical Function: IF + AND

Scipio

New Member
Joined
Aug 11, 2020
Messages
23
Office Version
  1. 365
Platform
  1. Windows
1666900330261.png


The formula in G37 reads: =IF(((G35+G36)<G31,G35+G36,G31)
However, that would return a negative number (1,557,306) in H37. So I need an IF/AND logical combination that says if (H35+H36)<H31 and H31 is >0, return H35+H36, otherwise return 0 (since H31 is negative, I can't show a negative Paid amount. Is there a logical combination of IF + AND that will make all of these scenarios work together in one formula that can be copied across row 37? The only other thing I can do is use the original formula for column G in column H and hard code a zero in H37, which is less than ideal. Would appreciate any help anyone out there could give me. Thanks in advance, Scipio.
 

Attachments

  • 1666900159883.png
    1666900159883.png
    2.8 KB · Views: 3
  • 1666900202374.png
    1666900202374.png
    4.3 KB · Views: 3
  • 1666900256111.png
    1666900256111.png
    8.4 KB · Views: 4

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
How about:
Excel Formula:
=MAX(MIN(G35+G36,G31),0)
 
Upvote 0
I wasn't able to get this to work.
For column H, just change the "G"s to "H"s, i.e.
Excel Formula:
=MAX(MIN(H35+H36,H31),0)

That formula returns 396149 in cell G37 and 0 in cell H37, just like you stated you wanted.
Please give me a specific example that doesn't return what you think it should.
 
Upvote 0
For column H, just change the "G"s to "H"s, i.e.
Excel Formula:
=MAX(MIN(H35+H36,H31),0)

That formula returns 396149 in cell G37 and 0 in cell H37, just like you stated you wanted.
Please give me a specific example that doesn't return what you think it should.
After investigating the MAX/MIN functions used together, I understand it and have used the formula provided in your post. Many thanks Joe --- I appreciate the help!
 
Upvote 0

Forum statistics

Threads
1,214,807
Messages
6,121,679
Members
449,047
Latest member
notmrdurden

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
Back
Top