Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VLookup, Max??? Newbie

Hello all, I hope you can help. I have queried a database using MSQuer
to create a worksheet with over 28000 clientID's for around 50000 records
The clients can be identified by their ID# in Col A. Each client is eligibl
for one or more programs for a certain time period. Elig from date is in col I,
Elig To Date is in Col J. The Program code is in Col H. About half of
them are listed in several rows (up to around 8) because they are or hav
been eligible for more than one program. I need to create a new worksheet
with a list of unique clientId's with the most current FSEligToDate
I know it can probably be done with formulas, but because of the number o
records, I'd like to do it with code. I'm pretty new to VBE & don't know where
to start. Any help would be greatyl appreciated.

ClientId FundingSourceId FS.EligFromDate FS.EligToDat
83108 4 20030101 2005032
83108 15 20030101 2003063
83108 16 20030102 2003123
83103 15 20030101 2003022
83118 15 20030103 2003123
83118 16 20030818 2004091
83118 22 20030103 2005010

The Results of which would be

ClientID FundingSourceID FSEligFromDate FSEligToDat
83108 4 20030101 2005032
83103 15 20030101 2003022
83118 22 20030103 2005010

I'm using XL2000 & WindowsNT. Thanks in advance
Please post to NG.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default VLookup, Max??? Newbie

Sort your data on fsEligToDate column, Descending, so the most recent dates
are at the top.

In the next available column, put in a formula like

You example doesn't match your description of column locations, but suspect
it is abbreviated. You have program 16, but show no results, assume this is
an oversight.

Assume column M is the next available column. Headers in row1 and first
date record in row2
Assume ID in column A, Program in column H and elig to date in col J


in M2 put the formula

=Sumproduct(--($A$2:A2=A2),--($H$2:H2=H2))
drag fill this down the column or if Column L has no blanks, select M2,
double click on the black square on the lower right of the outline to have
it automatically fill to the end of your data. This will progressively
count.

Now select A1 and do Data=Filter=Autofilter
select column M and filter on the value 1.

Select all you data, do edit=Copy, then go to a1 on a new sheet and do
Edit=PasteSpecial and select Values.

Repeat the paste Special with formats if you want the formats.

You can sort the new data on Id and program, delete column M.

--
Regards,
Tom Ogilvy




"Eric Smith" wrote in message
...
Hello all, I hope you can help. I have queried a database using MSQuery
to create a worksheet with over 28000 clientID's for around 50000

records.
The clients can be identified by their ID# in Col A. Each client is

eligible
for one or more programs for a certain time period. Elig from date is in

col I,
Elig To Date is in Col J. The Program code is in Col H. About half of
them are listed in several rows (up to around 8) because they are or have
been eligible for more than one program. I need to create a new

worksheet
with a list of unique clientId's with the most current FSEligToDate.
I know it can probably be done with formulas, but because of the number of
records, I'd like to do it with code. I'm pretty new to VBE & don't know

where
to start. Any help would be greatyl appreciated.

ClientId FundingSourceId FS.EligFromDate FS.EligToDate
83108 4 20030101 20050323
83108 15 20030101 20030630
83108 16 20030102 20031231
83103 15 20030101 20030228
83118 15 20030103 20031231
83118 16 20030818 20040916
83118 22 20030103 20050103

The Results of which would be:

ClientID FundingSourceID FSEligFromDate FSEligToDate
83108 4 20030101 20050323
83103 15 20030101 20030228
83118 22 20030103 20050103

I'm using XL2000 & WindowsNT. Thanks in advance.
Please post to NG.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VLOOKUP Newbie Question Mike C[_2_] Excel Worksheet Functions 5 April 18th 07 03:11 AM
Real Newbie newbie question Dave New Users to Excel 0 January 10th 07 07:55 PM
Help! Newbie tenaj Excel Discussion (Misc queries) 7 March 22nd 06 09:18 PM
vlookup (newbie, STILL) Ken New Users to Excel 5 December 30th 04 03:11 PM
Newbie Seeks VLOOKUP help Dave Peterson[_3_] Excel Programming 1 July 12th 03 04:32 PM


All times are GMT +1. The time now is 10:26 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"