View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Transfer Per catagory

Wonder if you missed the response earlier
------------------------------------------
Here's another play - formulas driven ...

Illustrated in this sample:
http://freefilehosting.net/download/40f35
Group Client by Last 3 Mths in a row Visits.xls

Source data in Sheet1, cols A & B, from row1 down.
Col A = Client names, Col B = real dates

In sheet: By Last 3 Mths in a row Visits,
In A2:
=IF(Sheet1!A1="","",IF(COUNTIF(Sheet1!A$1:A1,Sheet 1!A1)1,"",ROWS($1:1)))

In B2:
=IF(ROWS($1:1)COUNT(A:A),"",INDEX(Sheet1!A:A,SMAL L(A:A,ROWS($1:1))))
Copy A2:B2 down to cover the max expected extent of source data, eg down to
row100? This extracts dynamically the unique list of clients into col B (as
in the previous solution)

Label in C1:H1, the 1st-of-month real dates (formatted as mmm-yy) :
Jan-08, Feb-08, Mar-08, Apr-08, May-08, Jun-08

In C2:
=IF($B2="","",SUMPRODUCT((Sheet1!$A$1:$A$100=$B2)* (TEXT(Sheet1!$B$1:$B$100,"mmmyy")=TEXT(C$1,"mmmyy" ))*(Sheet1!$B$1:$B$100<"")))
Copy C2 across to H2, fill down. Adapt the ranges to suit the max expected
extent of source data. This part counts the client's visits in each mth/yr.

Labels in J1:M1 : Jan08-Mar08, Feb08-Apr08, Mar08-May08, Apr08-Jun08
In J2:
=IF(SUMPRODUCT(--($C2:$H2=""))=6,"",IF(AND(C20,D20,E20),ROW(),"" ))
Copy J2 across to O2, fill down. This part "flags" clients who visited 3
mths-in-a-row. The final results will be retrieved in the adjacent range cols
Q to T

In Q1, copied to T1: =J1 (to reproduce the col labels from left)
In Q2:
=IF(ROWS($1:1)COUNT(J:J),"",INDEX($B:$B,SMALL(J:J ,ROWS($1:1))))
Copy Q2 across to T2, fill down. Cols Q to T returns the desired results
(Hide away cols A to P).

Extend the construct to suit ..

P/s: The previous solution for your other posting in mid Sep08 is in sheet:
By Preferred Visit Day. I've retained it for your easy reference.
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:18,600 Files:362 Subscribers:60
xdemechanik
---