I am trying to add exceptions to a formula

rmbmst1972

New Member
Joined
Sep 29, 2018
Messages
14
Dear Sir or Madam:


My name is Robert, and I have just one more Excel formula issue before I fall asleep. The following formula works perfectly, but I want to add exceptions to it. I need Excel to find a cell that contains "minimum", "maximum", and range" with any other words except the following: "mean", "median", "mean absolute deviation", "interquartile range". If a cell contains "minimum", "maximum", and range" with any other words EXCLUDING the exceptions, I want to assign the result to a value of 2. If a cell contains "minimum", "maximum", and range" with any other words INCLUDING any of the exceptions, I want to assign the result to a value of 1.


=IF(L4="","",IF(AND(ISNUMBER(SEARCH("minimum",L4)),ISNUMBER(SEARCH("maximum",L4)),ISNUMBER(SEARCH("range",L4))),"2","0"))


Sincerely,
Robert
 
I don't completely understand what you mean by "Excel readable small sample". […]



Book1
ABC
1ORDER NO.TASKCREATED ON
2TT1234567SHIP1/1/2019
3TT1234567RPCK1/1/2019
4TT1234567PSHP1/2/2019
5(BLANK)CYCC1/1/2019
6TT1234567RPCK1/3/2019
7TT7654321RPCK1/10/2019
8TT9999999RPCK1/20/2019
9TT7654321SHIP1/25/2019
10TT8888888PSHP1/25/2019
Sheet2


This is an "excel readable small sample." Just copy and paste t in a sheet on your Excel system. You see you can use it immediately, that is, process it by means of formulas in order to generate a desired output.
 
Upvote 0

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
ABC
1The minimum would most likely stay the same because unless the hit was less than 10 then it shouldnt change. Its the same with the maximum. Unless his hit is higher than 50 then it shouldnt change either. All of the other things would change because a new number was added in. The mean would change.The median would change. The mean absolute deviation would change. The would change. And finally, the interequality would change as well.=IF(B1="","",IF(AND(ISNUMBER(SEARCH("minimum",B1)),ISNUMBER(SEARCH("maximum",B1)),ISNUMBER(SEARCH("range",B1)),NOT(ISNUMBER(SEARCH({"mean","median","mean absolute deviation","interquartile range"},B1)))),2,1))
2
3
4
5
6
7
8
9
10

<tbody>
</tbody>
Sheet2

This is an "excel readable small sample." Just copy and paste t in a sheet on your Excel system. You see you can use it immediately, that is, process it by means of formulas in order to generate a desired output.

Aladin,

I think I am about to call it quitting time soon because I am finding it more difficult to understand what you need from me. I don't know what else to do. Therefore, I hope I provided you with something that is productive. I tried to my table neat like yours, but I didn't have success.

Robert
 
Upvote 0
ABC
1ORDER NO.TASKCREATED ON
2TT1234567SHIP1/1/2019
3TT1234567RPCK1/1/2019
4TT1234567PSHP1/2/2019
5(BLANK)CYCC1/1/2019
6TT1234567RPCK1/3/2019
7TT7654321RPCK1/10/2019
8TT9999999RPCK1/20/2019
9TT7654321SHIP1/25/2019
10TT8888888PSHP1/25/2019

<colgroup><col style="width: 25pxpx"><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet2

This is an "excel readable small sample." Just copy and paste t in a sheet on your Excel system. You see you can use it immediately, that is, process it by means of formulas in order to generate a desired output.


Okay...I have an idea. I have created this formula. If you see understand what I am trying to do with it, I am hoping you can fill-in the missing pieces to make it work. It is now 3:00 am EST, and I need to go to bed. I will check my email again after I wake up.

=IF(L4="","",IF(AND(ISNUMBER(SEARCH("minimum",L4)),ISNUMBER(SEARCH("maximum",L4)),ISNUMBER(SEARCH("range",L4)),ISNUMBER(SEARCH({"mean","median","mean absolute deviation","interquartile range"},L4)),1,IF(AND(ISNUMBER(SEARCH("minimum",L4)),ISNUMBER(SEARCH("maximum",L4)),ISNUMBER(SEARCH("range",L4)),NOT(ISNUMBER(SEARCH({"mean","median","mean absolute deviation","interquartile range"},L4)))),2,0))
 
Upvote 0
Aladin,

I think I am about to call it quitting time soon because I am finding it more difficult to understand what you need from me. I don't know what else to do. Therefore, I hope I provided you with something that is productive. I tried to my table neat like yours, but I didn't have success.

Robert

Okay...I have an idea. I have created this formula. If you see understand what I am trying to do with it, I am hoping you can fill-in the missing pieces to make it work. It is now 3:00 am EST, and I need to go to bed. I will check my email again after I wake up.

=IF(L4="","",IF(AND(ISNUMBER(SEARCH("minimum",L4)),ISNUMBER(SEARCH("maximum",L4)),ISNUMBER(SEARCH("range",L4)),ISNUMBER(SEARCH({"mean","median","mean absolute deviation","interquartile range"},L4)),1,IF(AND(ISNUMBER(SEARCH("minimum",L4)),ISNUMBER(SEARCH("maximum",L4)),ISNUMBER(SEARCH("range",L4)),NOT(ISNUMBER(SEARCH({"mean","median","mean absolute deviation","interquartile range"},L4)))),2,0))


I just want a sample from you with which can work, not formulas. That's all. (By the way, I tried to show you what posting a sample means.)
 
Upvote 0
This kind of formula really works best if you make an external table with the conditions you want. That way it's MUCH easier to change, read, and understand. For example, if I understand your request:

BCDEFG
1The minimum would most likely stay the same because unless the hit was less than 10 then it shouldnt change. Its the same with the maximum. Unless his hit is higher than 50 then it shouldnt change either. All of the other things would change because a new number was added in. The mean would change.The median would change. The mean absolute deviation would change. The would change. And finally, the interequality would change as well. The range would increase.<
/td>
2Score:Points:21
31Condition:Word list0=include, 1 = excludeWord list0=include, 1 = exclude
4minimum0minimum0
5maximum0maximum0
6range0range0
7mean1
8median1
9mean absolute deviation1
10interquartile range1
11

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet20

Array Formulasble>Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself
CellFormula
B3{=IF(PRODUCT(ISNUMBER(SEARCH($D$4:$D$11,B1))-$E$4:$E$11),$D$2,IF((PRODUCT(ISNUMBER(SEARCH($F$4:$F$11,B1))-$G$4:$G$11)),$F$2,0))}

<thead>
</thead><tbody>
</tbody>



In D2 put the number of points you want. In D4:D11 put your word list, and in the corresponding row in column E, put a 0 if the word must be included, or a 1 if it must be excluded. Repeat in columns F:G. Then the B3 formula should do what you want.

I've been playing around with a shorter formula that allows adding more columns easily, but it requires a pretty awkward table in its current incarnation.

<tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,214,585
Messages
6,120,394
Members
448,957
Latest member
Hat4Life

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