IF/AND/OR Statement

tlc53

Active Member
Joined
Jul 26, 2018
Messages
399
Hi there,

=IF(AND(OR($D$8="Trust - Business",$D$8="Company"),$F$47>0),"494"),IF($F$47>0,"465/"&LEFT($D$28,3),)

So if D8 = "Trust - Business" or "Company" and F47 >0, return "494", but if it doesn't equal "Trust - Business" or "Company" and F47 >0 return "465/" and then first 3 characters of D28. If F47 is not more than zero, return blank.

I can kind of see where I'm going wrong but not sure how to fix it. If F47>0 then both statements are true.

Can someone shed some light please? Thank you
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
=IF(AND(OR(D8={"Trust-Business","Company"}),F47>0),494,IF(F47>0,465&LEFT(D28,3),""))
 
Upvote 0
Hi again,

Would you be able to help me extend the formula further..

Same criteria but if F47 less than zero, return different values. So basically a combination of these two codes;

=IF(AND(OR(D8={"Trust - Business","Company"}),F47>0),494,IF(F47>0,"465/"&LEFT(D28,3),""))
=IF(AND(OR(D8={"Trust - Business","Company"}),F47<0),474,IF(F47<0,"495/"&LEFT(D28,3),""))

And if equals 0, return blank. I've worked out it's not as simple as just adding them together.

Thank you!!
 
Upvote 0
=IF(F47=0,"",IF(OR(D8={"Trust - Business","Company"}),IF(F47>0,494,474),IF(F47>0,"465/","495/")&LEFT(D28,3)))
 
Upvote 0
Awesome! Thank you.
It makes sense now that I see it, and how you deal with the zero return first.
You've helped me out heaps. Thanks!
 
Upvote 0

Forum statistics

Threads
1,223,711
Messages
6,174,025
Members
452,542
Latest member
Bricklin

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