G'day all,
I'm attempting to summarise a large dataset with formulae as opposed to a pivot table. I would, of course, usually use a pivot table, but this issue is only part of the overall task which involves me updating a table on a monthly basis using VBA.
Anyhow, i'm currently at the testing stage and i want to make sure that my calculations are correct. This is where i am so far.
My dataset:
Person_ID------Service-----Group------start------end_date
01245----------Res---------A----------1/7/08-----3/9/08
085699---------Nurs--------A----------5/2/98-----5/7/07
01245----------Res---------A----------1/6/08-----3/9/08
085699---------Per---------A----------11/7/05----5/12/07
65895254-------Res---------B----------5/12/06----
897516---------Nurs--------B----------12/6/97----13/5/08
798585---------Res---------B----------7/6/05-----12/7/08
0187985--------Res---------A----------8/7/07-----13/9/08
etc... for some 50,000+ rows
I have created some named range thus:
Person_ID = ID
Service = Service
Group = group
Start = Start
End_date = end
and written some sumproduct formula's like this
=sumproduct((Service="Res")*(group="A")*(start<=15/08/2008)*(end>=15/08/2008))
This formula gives me an answer of "Current" records that meet the criteria in the sumproduct, in this case 3!
However, what i would really like to to discount where ID's are duplicated. These duplicates are not duplicate records, as there are further columns to the dataset, but i want to count people not records.
What additional arguements on "ID" would i have to add to my sumproduct to achieve this? The result i would like is 2 with the records of Person_ID 01245 only being counted once.
Please excuse the long post, i just wanted to be as clear as possible.
Many thanks in advance for your help!
Cheers
I'm attempting to summarise a large dataset with formulae as opposed to a pivot table. I would, of course, usually use a pivot table, but this issue is only part of the overall task which involves me updating a table on a monthly basis using VBA.
Anyhow, i'm currently at the testing stage and i want to make sure that my calculations are correct. This is where i am so far.
My dataset:
Person_ID------Service-----Group------start------end_date
01245----------Res---------A----------1/7/08-----3/9/08
085699---------Nurs--------A----------5/2/98-----5/7/07
01245----------Res---------A----------1/6/08-----3/9/08
085699---------Per---------A----------11/7/05----5/12/07
65895254-------Res---------B----------5/12/06----
897516---------Nurs--------B----------12/6/97----13/5/08
798585---------Res---------B----------7/6/05-----12/7/08
0187985--------Res---------A----------8/7/07-----13/9/08
etc... for some 50,000+ rows
I have created some named range thus:
Person_ID = ID
Service = Service
Group = group
Start = Start
End_date = end
and written some sumproduct formula's like this
=sumproduct((Service="Res")*(group="A")*(start<=15/08/2008)*(end>=15/08/2008))
This formula gives me an answer of "Current" records that meet the criteria in the sumproduct, in this case 3!
However, what i would really like to to discount where ID's are duplicated. These duplicates are not duplicate records, as there are further columns to the dataset, but i want to count people not records.
What additional arguements on "ID" would i have to add to my sumproduct to achieve this? The result i would like is 2 with the records of Person_ID 01245 only being counted once.
Please excuse the long post, i just wanted to be as clear as possible.
Many thanks in advance for your help!
Cheers