Solved

Unique count

Posted on 2011-09-06
3
247 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
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.

690 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