简体   繁体   中英

Excel Function to return yes / no if cell contains all instances of results

In search of an excel function to return ay/n answer if both men and women hold the same position

here's the problem.

there's an employee list with a columns for their "ID", "working title", "Genre" (this list only has 1 id per record, but the same working title (and gender) can appear for multiple individuals)

i need to have a column that returns true/false, or yes/no... if a particular "working title" contains both the instance of having a "Male" and "female"

ex:

在此处输入图像描述

would show in a table with all working titles as:

在此处输入图像描述

So, went with IF(), AND() and COUNTIFS() like so:

=IF(AND(COUNTIFS($B$2:$B$9,"M",$A$2:$A$9,C2),COUNTIFS($B$2:$B$9,"F",$A$2:$A$9,C2)),"Yes","No")

NOTE: None of the insert picture or other editing buttons are available as I enter this - not sure why. Now they are working - must be a glitch somewhere, here is the image I would have added earlier:

在此处输入图像描述

However, For my answer I had to assume that the working title is cell A1.

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