If Statement Brain Fart Both Conditions are True

ac66bronco

New Member
Joined
Dec 10, 2014
Messages
35
Guys and Gals. I am having a brain fart.

I am usually pretty decent with If statements but my new job hasn't been challenging me and I am becoming forgetful.

I am checking to see if a Principal and Interest for a 360 month mortgage or a 480 month mortgage are less than a set figure.

My problem is this. The set P&I is 632.07, the P&I for 360 is 519.62 and the P&I for 480 is 433.69. Both are returning True because both are less than 632.07

What I want the formula to do is return 360

I've been playing around with this and flipping and flopping signs but its just not working.

=IF(AND(N38="TRUE",N46="TRUE",M38>M46),"360","480")
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Your question is confusing to me, especially since we cannot see any of your data.
Could you please show us a handful of examples (data) and your expected results for the different scenarios?

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0
I figured it would be and working for a bank... sensitive data. I think I can get away with a screenshot.

Red Square is what I need either the 30-year ( Purple) or 40-year (green) to be less than.

I am trying to devise a formula for the orange squares to return the values of either the purple or green data (whichever one is first in being under the value in red). But my problem arises when both data sets are true. It won't return the purple data set first.
 

Attachments

  • 2024-12-31_11-52-17.png
    2024-12-31_11-52-17.png
    84.7 KB · Views: 8
Upvote 0
If they are both true, use the MAX function to return the maximum of those two values.
 
Upvote 0
Also, just pointing out that TRUE/FALSE are Boolean values in Excel and thus unnecessary to put in quotes, but you don't usually need to put them at all.

=IF(AND(N38,N46,M38>M46),"What to do if True","What to do if False")
 
Upvote 0
Also, just pointing out that TRUE/FALSE are Boolean values in Excel and thus unnecessary to put in quotes, but you don't usually need to put them at all.

=IF(AND(N38,N46,M38>M46),"What to do if True","What to do if False")
That worked beautifully! I have no idea why I couldn't think of it!!!!

This was much better than the MAX (simply because I never worked with it before) but now that I know it exists I will play around with it in my free time.

Thank you both for your prompt help and suggestions
 
Upvote 0
If you use named cells then everything is much easier.
if N38 represents "is a customer" then name the cell "isCustomer"
suppose M38 > M46 means "paymentOverDue" or "accountOverDrawn" then create a cell named "accountOverDrawn" whose formulas is M38>M46
That cell will now hold a boolean (true/false) for that condition
Now your formula can look like:
if (and (isCustomer, paymentOverDue),"Send eviction notice","Send holiday greeting")
 
Upvote 0

Forum statistics

Threads
1,225,757
Messages
6,186,848
Members
453,379
Latest member
gabriellegonzalez

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