Thursday 27 September 2018

microsoft excel - Count if two criteria match while ignoring duplicates


I have a simple Sheet with 2 cells that I need to countif 2 conditions match and treat duplicates as 1.


Column A    Column B
Male closed
Female invalid #
Male exception
Male closed
Male closed
Female new

I would like a formula that counts Male closed and return 1 result (ignoring duplicates)



Answer



If you just want to count the different order numbers (in column B) that are complete (column A) try this


=SUM(IF(FREQUENCY(IF(A$2:A$100="Complete",MATCH(B$2:B$100,B$2:B$100,0)),ROW(B$2:B$100)-ROW(B$2)+1),1))


confirmed with CTRL+SHIFT+ENTER


To add another condition, e.g. assuming status in A and Store Id in B as before but with Sales Reps in column C you can use this version


=SUM(IF(FREQUENCY(IF(A$2:A$100="Complete",IF(C$2:C$100="Rep1",MATCH(B$2:B$100,B$2:B$100,0))),ROW(B$2:B$100)-ROW(B$2)+1),1))


of course you can use cells to store the criteria if you wish


No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...