Multiple IF conditions using AND, OR, NOT

johobie

New Member
Joined
Jan 28, 2022
Messages
24
Office Version
  1. 365
Platform
  1. Windows
Data:
Row​
A​
B​
C​
D​
E​
1​
AcquisitionCALLJoheen-3,000.003,000.00
2​
BuyCALLCure-5,266.505,266.50
3​
BuyAfterburn-619.50

Formula not working:
=IF(ISNUMBER(SEARCH("Acquisition",$A1))*OR(ISNUMBER(SEARCH("Buy",$A1)))*NOT(ISNUMBER(SEARCH("CALL",$B1))),-$D1,"")

I want to solve for:
If False: If A1 contains "Acquisition" OR if A1 contains "Buy" and B1 does NOT contain "CALL", then fill E1 with no value ("").
If True: If A1 contains "Acquisition" OR if A1 contains "Buy" and B1 does contain "CALL", then fill E1 with negative value of D1.
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
This is what you have asked for so far, but what if A1 does not contain either "Acquisition" or "Buy"?
Excel Formula:
=IF(OR(ISNUMBER(SEARCH({"Buy","Acquisition"},$A1))),IF(ISNUMBER(SEARCH("CALL",$B1)),-$D1,""))
 
Upvote 0
Depending if A only have the given value and not part of a string

=IF(AND(OR(A1=“Acquisition”,A1=“Buy”),B1<>”CALL”),””,-D1)
 
Upvote 0
This is what you have asked for so far, but what if A1 does not contain either "Acquisition" or "Buy"?
Excel Formula:
=IF(OR(ISNUMBER(SEARCH({"Buy","Acquisition"},$A1))),IF(ISNUMBER(SEARCH("CALL",$B1)),-$D1,""))
Thank you for the quick reply!
You are right, any suggestion on how I fill E1 with no value should A1 contain either another text OR nothing?
This is getting above my grade level.
 
Upvote 0
Depending if A only have the given value and not part of a string

=IF(AND(OR(A1=“Acquisition”,A1=“Buy”),B1<>”CALL”),””,-D1)
Tried the above and not getting value or no value:
A1 contains Buy, B1 does not contain CALL. Result is: #name?
A1 contains Buy, B1 does contain CALL. Result is: #name?
A1 contains Acquisition, B1 contains CALL. Result is #name?
A1 contains Acquisition, B1 does not contain CALL. Result is #name?
 
Upvote 0
Depending if A only have the given value and not part of a string

=IF(AND(OR(A1=“Acquisition”,A1=“Buy”),B1<>”CALL”),””,-D1)
Thank you for the quick reply! It is not part of a string.
You are right, any suggestion on how I fill E1 with no value should A1 contain either another text OR nothing?
This is getting above my grade level.
 
Upvote 0
Depending if A only have the given value and not part of a string

=IF(AND(OR(A1=“Acquisition”,A1=“Buy”),B1<>”CALL”),””,-D1)

Tried the above and not getting value or no value:
A1 contains Buy, B1 does not contain CALL. Result is: #name?
A1 contains Buy, B1 does contain CALL. Result is: #name?
A1 contains Acquisition, B1 contains CALL. Result is #name?
A1 contains Acquisition, B1 does not contain CALL. Result is #name?

Hi,

You need to Re-type henrik2h formula from post # 3 using proper quote marks, e.g. "
He was probably not on a computer at the time, hence the quote marks are "slanted"

Excel Formula:
=IF(AND(OR(A1="Acquisition",A1="Buy"),B1<>"CALL"),"",-D1)
 
Upvote 0
Solution
It is not part of a string.
any suggestion on how I fill E1 with no value should A1 contain either another text OR nothing?
This is getting above my grade level.

This should do what you want:

Book3.xlsx
ABCDE
1AcquisitionCALLJoheen-3,000.003000
2BuyCALLCure-5,266.505266.5
3TBDCALLAfterburn-619.5 
4CALLCure-5266.5 
5AcquisitionJoheen-3000 
Sheet966
Cell Formulas
RangeFormula
E1:E5E1=IF(AND(OR(A1={"Acquisition","Buy"}),B1="CALL"),-D1,"")
 
Upvote 0
Hi,

You need to Re-type henrik2h formula from post # 3 using proper quote marks, e.g. "
He was probably not on a computer at the time, hence the quote marks are "slanted"

Excel Formula:
=IF(AND(OR(A1="Acquisition",A1="Buy"),B1<>"CALL"),"",-D1)
Thank you jtakw! I did not see the quotations were different.
Thank you henrik2h!
Thank you jasonb75!
 
Upvote 0
any suggestion on how I fill E1 with no value should A1 contain either another text OR nothing?

You're welcome, you should use my formula from Post # 8 and Not from #7, they are not the same, due to your latest requirements underlined and Bold above.
 
Upvote 0

Forum statistics

Threads
1,215,456
Messages
6,124,939
Members
449,197
Latest member
k_bs

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