Solved

Unique count

Posted on 2011-09-06
3
224 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
ID: 36490114
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
ID: 36490223
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
ID: 36490308
Thanks a lot.
I really made my task easy.
0

Featured Post

ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

770 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