Solved

Unique count

Posted on 2011-09-06
3
205 Views
Last Modified: 2012-05-12
hi,

I have 3 columns , column A with date and coulmn B with name of employee and column C with work type.
I want to know the number of days workded by each employee.
1-Feb      a
1-Feb      a
2-Feb      a
2-Feb      a
2-Feb      a
2-Feb      a
2-Feb      a
2-Feb      a
4-Feb      a
4-Feb      a
4-Feb      a
4-Feb      a
1-Feb      B
1-Feb      B
1-Feb      B
2-Feb      B
2-Feb      B
2-Feb      B
2-Feb      B
2-Feb      B
2-Feb      B
3-Feb      B
3-Feb      B
3-Feb      B
3-Feb      B
3-Feb      B


here a should give answer 3 as he has worked for 3 days (1st, 2nd and 4th of Feb)
similarly B should give answer 3 as he has worked for 3 dys.(1st, 2nd and 3rd of Feb)


 
0
Comment
Question by:VasuSidhu
3 Comments
 
LVL 45

Expert Comment

by:aikimark
Comment Utility
do you know how to create a pivot table?  That should be able to give you a breakdown of all employees and the days they worked.

How do you need to use this days-worked count? (in code, in formula, other)
0
 
LVL 18

Accepted Solution

by:
krishnakrkc earned 500 total points
Comment Utility
Hi,

Here is a formula solution..

=SUM(IF(FREQUENCY(IF($B$2:$B$27=D2,IF($A$2:$A$27<>"",MATCH($A$2:$A$27,$A$2:$A$27,0))),ROW($A$2:$A$27)-ROW($A$2)+1),1))

where D2 holds "a"

It's an array formula. Confirmed with CTRL + SHIFT + ENTER.

0
 

Author Closing Comment

by:VasuSidhu
Comment Utility
Thanks a lot.
I really made my task easy.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now