AboutAidan Heritage Expertise I have provided first hand support since `95 for Microsoft Office majoring in Word and Excel - support for
all versions from 2 onwards
Experience My background is in the insurance industry and call centre areas, but have been called upon to provide many varied solutions.
Education/Credentials I'm educated to UK A level standard, but as I left school some 30 years ago that is rather irrelevent - university of life has provided more of a background!
Question QUESTION: I need help coming up with a formula that will return in a third column either a 1 or a 0 based on name and date criteria within two other columns.
Specifically, I am trying to come up with an employee Head Count per bill date. My data sheet includes a WEBillDate column, and an EmpName column. However, our week ending bill dates are based on 2 work weeks, so an employee often appears twice in the same Week End Bill Date. I need only count the employee once per Bill Date for our billing head count.
So for a simplified example, the columns in my data spreadsheet would look like so:
WEBillDate EmpName HeadCount
01-06-08 Jane Doe 1
01-06-08 Jane Doe 0
01-06-08 Jimmy Doe 1
01-20-08 Jane Doe 1
01-20-08 Jimmy Doe 1
01-20-08 Jimmy Doe 0
Ultimately, I intend to have Excel automatically subtotal (within a pivot table) the ‘headcount’ column per WEBillDate. But for every Week End Bill Date there are nearly a thousand rows and I don’t wish to manually enter the information. There must be a better way? Possibly not even using the 1,0 argument, but something that would just count and filter simultaneously?
Any help GREATLY appreciated!!
- Alicia
ANSWER: I'm sure I'm missing something here, but wouldn't the pivot table be the way to go - this would group on names and bill dates, so you would automatically get the unique counts you need? If I've misunderstood, please let me know - and if it helps to email me (eg with sample files) you can get me at aidan.heritage@virgin.net
---------- FOLLOW-UP ----------
QUESTION: I've tried just using the pivot table, but using the count function on the field in question only gives me a count of all instances of the employee name, even the duplicates. I need to just get the count of all names per time period, not each instance of the name. Obviously, I can manually click and drag over the name results to get a manual count, but it doens't populate a workable field if I do that, I have to place that field outside of the pivot table, which sort of defeats the purpose of those fantastic pivot tables.. I am by no means an expert - is there a way in a pivot table to automatically filter out the duplicate names? I would gladly send you a smaller version of my file if this is still unclear..
Answer You may possibly be thinking along the lines of the pivot table you want to use for your final output, rather than a pivot table to combine the values - you may well need two files, but a pivot table would by definition group on whatever you want - so putting the employee name in the left side and the date as the heading should give you the totals you need.
Email me a sample file and I can show you what I'm getting at. (aidan.heritage@virgin.net)
About Excel
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here