Excel - Search in a column to find if the text matches and counts the string


I want to add values from 1 worksheet to another.

The first worksheet ("November 2011") simply contains name & status, names are however duplicated and a percentage of a string needs to be added on the second worksheet ("Sales").

e.g. "November 2011"

    A           B
1   Name        Status
2   McDonalds   Completed
3   McDonalds   Won
4   Burger King Won
5   Burger King Won
6   Wendys      Completed
7   iHop        Completed
8   iHop        Completed

The second worksheet ("Sales") contains 3 columns Name, Completed & Won. However, Name has had duplicates removed.

e.g. "Sales"

    A           B           C
1   Name        Completed   Won
2   McDonalds
3   Burger King
4   Wendys
5   iHop

I want the "Sales" worksheet to look like this however:

    A           B           C
1   Name        Completed   Won
2   McDonalds   50%         50%
3   Burger King 0%          100%
4   Wendys      100%        0%
5   iHop        100%        0%

Just wondering what formula to use? It needs to check against the name.

I'd use a countif function to find the number of sales and countifs to find the number of wins and completed.

=COUNTIFS('November 2011'!$A:$A, A2, 'November 2011'!$B:$B, "won")
  / COUNTIF('November 2011'!$A:$A,A2)

This would give you the ratio or percent if formatted of the won.