简体   繁体   中英

=FILTER an inverse result of a partial string match in Excel

Summary

I am attempting to filter out a dataset within Excel using =FILTER . I would like to search the dataset for a partial string, and filter these results out.

Current Progress

I am aware of the use of <> within = FILTER to omit results. My current method to find the string is to use ISNUMBER(SEARCH("postmaster",A:A)) to find all results that have "postmaster" within the cell contents. I have attempted to combine both uses, into the following:

=FILTER(A:A,(A:A<>"foo@bar.com")*(A:A<>0)*(ISNUMBER(SEARCH("postmaster",A:A)))) Currently, this removes all results with "foo@bar.com" in column A, but then only shows those that contain "postmaster". I am trying to invert this, so it instead filters OUT any that contain postmaster. I want to combine the ISNUMBER / SEARCH logic with the <> exclude logic. Is this possible?

Conclusion I am aware of the premise, but am unable to put them together. I'd appreciate any help in doing this. I am using MSO 365, version 2108. Thanks!

After further tinkering, I found the solution. This was to wrap the ISNUMBER SEARCH within a =NOT statement, to invert the output.

The new working formula is:

=FILTER(A:A,(A:A<>"foo@bar.com")*(A:A<>0)*(NOT(ISNUMBER(SEARCH("postmaster",A:A)))))

If anyone wants to exclude results from a partial string match, they can use the following example:

=FILTER(DATA:DATA,NOT(ISNUMBER(SEARCH("STRINGTOSEARCH",DATA:DATA))))

Hopefully this helps someone else in the future!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM