简体   繁体   中英

Formula or way (in excel) to count column A only if column B of the same row is the first of it's kind and column A is less then a specified value?

I am embarking on a new project and am curious if I am able to be selectively count a column only if another column of the same row is the first of its kind.

Situation: column A contains people's names, which sometimes might duplicate. Column B contains amount of money spent by those people in a shop. I am only interested in people who spent less then a dollar in that shop and for those people who spent less then a dollar in the shop, their names might have duplicates but I only want to count them once, is there a excel function to do so? (eg, Mathew is a person that spends less then a dollar, his name appeared twice but I only want to count him once aka count distinct)

You can use the FILTER function to first return a list of names that have spent under a certain amount, and then use the UNIQUE function to remove duplicates.

=UNIQUE(FILTER(A2:A17,B2:B17<2))

2美元以下的名字

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