Add a Condition to Existing Formula

meppwc

Well-known Member
Joined
May 16, 2003
Messages
626
Office Version
  1. 365
Platform
  1. Windows
The formula below works perfectly. I am hoping to add one additional condition it that basically tells the formula to run or not to run at all.

The table in the formula below is used for lookup is in column A of the “Table” worksheet (cells A2 to A30.
On the “Table” worksheet, in column “X” if the word “No” appears, then the formula is not run. But if the cell in “X” is blank, then the formula runs as it currently does. So, the logic that I need to add is if a cell in “X” has the value of “No”, then do not run the formula.

I apologize if this is too wordy or is confusing. I tried my best to word it as accurately as possible.

=IF(OR(C200<1,A200=0),"",IFERROR(LOOKUP(2^15,SEARCH(Table!$A$2:$A$30,A200),Table!$A$2:$A$30),""))
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Hi,

Technically, you can't add a condition to Stop or make the formula not run, you can only add conditions and make a formula give you a certain result.
If I understand you correctly, can you just add that if Column X is "No", then return "" Blank to the beginning of your formula by adding another OR criteria?

=IF(OR(C200<1,A200=0,X200="No"),"",IFERROR(LOOKUP(2^15,SEARCH(Table!$A$2:$A$30,A200),Table!$A$2:$A$30),""))
 
Upvote 0
I do understand what you are saying. In looking at the addition to the formula that you have provided I believe there is an error...............the formula resides on worksheet "tblAvailableItems"...........the column "X" that I refer to is on worksheet page "Table".............the addition that you made (X200="No") seems that it is looking for the word "No" in column X of the tblAvailableItems worksheet and not the Tables worksheet
 
Upvote 0
Then just add the tab name:

=IF(OR(C200<1,A200=0,Table!X200="No"),"",IFERROR(LOOKUP(2^15,SEARCH(Table!$A$2:$A$30,A200),Table!$A$2:$A$30),""))
 
Upvote 0
It's a little hard to help you without actually seeing some sample data. One thing that stands out is where you have the IFERROR statement. If you put that there it's going to run regardless if the first OR conditions are not meet "IF(OR(C200<1,A200=0)" because it's placed where the IF statement = false.

You can nest IF statements so maybe that is the route you need to take.

Logic - =IF(OR(RULES,"TRUE","FALSE")

I.E. =IF(OR(RULES,"RESULT IF YES",IF(OR(RULES,"RESULT IF TRUE",IF(OR(RULES....

Not sure how much that helps but we can probably figure this out if you provide a little bit of a sample.
 
Last edited:
Upvote 0
I am sorry jtakw..........that did not work................and uacdub I understand about not seeing some sample data...............do I have the option to upload an excel spreadsheet to the forum?
 
Upvote 0
Selected "Go Advanced" and still don't see an option to create a table..............I feel like such an idiot
 
Upvote 0
I am sorry jtakw..........that did not work................and uacdub I understand about not seeing some sample data...............do I have the option to upload an excel spreadsheet to the forum?

Sorry, don't think that the OR function supports 3D, try this:

=IF(Table!X200="No","",IF(OR(C200<1,A200=0),"",IFERROR(LOOKUP(2^15,SEARCH(Table!$A$2:$A$30,A200),Table!$A$2:$A$30),"")))
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,324
Members
452,635
Latest member
laura12345

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