In a subset of cells, determine if at least one co

2019-09-08 03:49发布

问题:

Given a table (spreadsheet) of two columns, for a subset of cells in column A that meet a particular criterion, determine if at least one of the corresponding cells in column B meet some other criterion.

For example, given the following data:

     A     B
1    DR    *
2    DR    &
3    SR    &
4    DR    *
5    SR    #
6    SR    #

I would like to know, for the subset of cells in column A that contain "DR", if there is at least one corresponding cell in column B that contains a "*". So, then, for "DR" the answer is true, but for "SR" the answer is false.

I have looked at a variety of "count if two criteria match" answers on here, but that doesn't seem to be quite it. (Or, if it is, I don't see how to make those solutions work for my example.)

回答1:

= CountIfs( A:A, "DR", B:B, "~*" ) > 0

~ is needed just for any * or ? characters.

COUNTIFS function