Excel - Macro|group by|based on time interval

Closed
vreexs Posts 2 Registration date Friday June 3, 2011 Status Member Last seen June 3, 2011 - Jun 3, 2011 at 11:10 AM
vreexs Posts 2 Registration date Friday June 3, 2011 Status Member Last seen June 3, 2011 - Jun 3, 2011 at 01:50 PM
Hello,

I need to write a macro for following example (copy and paste to excel with comma separated ',' delimiter). MS start and MS end column have a sub-column which are base, planned and actual column.



NO,ProjectID,Category,MS start,,,MS end,,
,,,base,planned,actual,base,planned,actual
1,1121,1,1-Jan-10,3-Jan-10,3-Jan-10,31-Mar-10,2-Apr-10,4-Apr-10
2,1411,1,2-Jan-10,4-Jan-10,5-Jan-10,22-Mar-10,25-Mar-10,24-Mar-10
3,3391,3,3-Jan-10,5-Jan-10,4-Jan-10,31-Mar-10,1-Apr-10,3-Apr-10
4,2552,2,4-Jan-10,5-Jan-10,7-Jan-10,26-Mar-10,28-Mar-10,28-Mar-10
5,2855,2,5-Jan-10,7-Jan-10,6-Jan-10,30-Mar-10,31-Mar-10,3-Apr-10
6,2325,2,6-Jan-10,9-Jan-10,11-Jan-10,16-Mar-10,18-Mar-10,20-Mar-10
7,2562,2,7-Jan-10,8-Jan-10,12-Jan-10,28-Mar-10,29-Mar-10,1-Apr-10
8,1121,1,8-Jan-10,11-Jan-10,10-Jan-10,30-Mar-10,1-Apr-10,4-Apr-10
9,3801,3,9-Jan-10,11-Jan-10,14-Jan-10,13-Mar-10,16-Mar-10,14-Mar-10
10,2719,2,9-Jan-10,11-Jan-10,10-Jan-10,8-Apr-10,11-Apr-10,13-Apr-10

Basically I want to group by Column Category. then, subgroup it by column base, planned and actual. then count the occurance of each column category based on the time interval (in month) between MS start and MS end. In this case, the result on new sheet would be as below:


Category 1
Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
Base
Planned
Actual

Category 2
Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
Base
Planned
Actual

Category 3
Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
Base
Planned
Actual

Hope this make sense.

Can anyone help me write an excel macro for this please? Thank you in advance.

Related:

2 responses

rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Jun 3, 2011 at 11:15 AM
Based on your sample data, what would be the output ?

Since it is hard to see the columns, could you please upload a sample EXCEL file WITH sample data, macro, formula , conditional formatting etc on some shared site like https://accounts.google.com/ServiceLogin?passive=1209600&continue=https://docs.google.com/&followup=https://docs.google.com/&emr=1 http://wikisend.com/ , http://www.editgrid.com etc
AND post back here the link to allow better understanding of how it is now and how you foresee. Based on the sample book, could you re-explain your problem too.


Note: your data need not be to be real data but a good representative of how data looks like
0
vreexs Posts 2 Registration date Friday June 3, 2011 Status Member Last seen June 3, 2011
Jun 3, 2011 at 01:50 PM
Hi rizvisa1,

thanks for the prompt response. my appologize for not describing my problem clearly. the sample excel file is in the following URL.

https://spreadsheets2.google.com/spreadsheet/pub?key=0Au5fnTRIShgudFFQN2Rka3R0dnBGRkJnSHllRk5zQVE&output=html

The sample data is in "sample input data" sheet. it does not have any macro nor formula and the output i foresee is in "expected outcome" sheet.

if you see the column name in the "sample input data" sheet, basically the solution is to count how many project for each month and for each category (valued 1, 2 and 3) split to base, planned and actual.

hope this would make it more clear and thank you

rgds,

[vf]
0