Hi John,
John James said:
Thanks, Jim
It's been a bit foreign not having a programming background, but I
think I've got it now through your help. So in the formula
=OR(ISNUMBER(SEARCH({"Mr ";"Mrs ";"Dr ";"Miss "},A4)))=FALSE:
1. The Braces identify the individual entries in an array. Call it
Array1.
2. The semicolons indicate that Array1 is horizontal (across columns)
as compared to commas which indicate that an array is vertical (across
rows)
3. The A4 reference locates the cell tested (the first entry in the
Array2 to be evaluated)
4. The search formula evaluates each item in the 6 (Array2) x 4
(Array1) array to a number, if found, otherwise to an error. This
produces Array3.
5. The Isnumber converts Array3 (these 6x4 numbers/errors) to Array4
(another 6x4 True/False table of matches between the two arrays)
6. The Or evaluates each row of the Array4 to produce Array5 (6x1).
These rows evaluate to True if any true exists within the Row.
7. The =False convert these six row Boolean values to the opposite
Boolean. This is no longer a 6x1 array but an individual formula,
which is why the formula doesn't need to be entered as an array. I
assume you could just as easily use the Not() formula instead of
=False.
Definitely, that would be the orthodox way to do it, it's just me, I don't
like the word NOT <bg>
so somethimes I play around a bit. But you are right, in Excel school I
would probably have used
=NOT(OR(ISNUMBER(SEARCH({"Mr ";"Mrs ";"Dr ";"Miss "},A4))))
The thing with advanced filter formulas is that sometimes you have to
reverse the normal thinking with arrays where you try to find the logic to
create TRUE and convert them to 1s whereas in this case you want to exclude
some values and for these values you are looking for a way to return FALSE
Re your query, Jim, the fact that Peo's formula works appears to prove
that a heading hasn't been forced by the Excel Developers for computed
criterion. Whilst I was surprised, I can't see any problem in them
taking this approach. This criterion entry was not like a standard
filter criterion where you need to identify the table's row heading so
that Excel knows which column to apply the criterion to. In this
instance, Peo's method is a computed filter criteria. Rather than
adding a new column to the table (which would require a new heading),
this "column" of data is held in memory without specific cell locations
to attach to. Excel knows which column to base the calculations on
through the specification of cell A4 in Peo's formula.
Correct, if there are more columns you need to filter you can include cells
from those columns in a formula as well.
e.g.
Assume we have the same setup and wants to exclude the titles (Mrs Mr etc)
and we also have values in B,
assume we have a header called Values and
1
2
3
4
5
6
in B4:B9
so we want exclude the Mrs.Mr/Dr/Miss titles and exclude values less than 5
meaning if done correctly we should get
Names Values
Black Medical Centre 5
the formula could look like
=AND(NOT(OR(ISNUMBER(SEARCH({"Mr ","Mrs ","Dr ","Miss "},A4)))),B4>4)
(using NOT this time)
The advanced filter is very powerful to use once you get the hang of the
weird setup,
it's very fast and on the plus side is that if you learn it you will know
how to use the D functions as well
Peo