View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Richard Buttrey Richard Buttrey is offline
external usenet poster
 
Posts: 296
Default Finding last record in month for each of several types of record.

Hi,

Thanks for the idea. Unfortunately it's not quite what I want.

What I need is the sum of the values, of the last record in each
month, for each type. i.e. I'm not interested in all the individual
daily records only the final record in each month.

All the records are themselves cumulative bank accounts which is why
I'm just trying to get the last reported record in each month, and add
these up to create a cumulative year to date value. Summing two month
end records at the end of month 2, three month end records at the end
of month 3, etc..

The last record in a month may not necessarily be on the last day of
the month.

Regards

Richard





On Sat, 2 Apr 2005 22:25:06 -0800, gocush
/delete wrote:

Richard
Does this work for you:

In your database, include a field for Type. Say for discussion you have
types A, B, C and D. Each record would have one of these types.
Also add a column for the Month. Say your Date field is in Col C. And Col
D is the Month field. If you db fieldnames are in row 1 and data starts in
row 2 then in D2 enter: =Month(C1) and copy this down col D

Then Sort your db first on your Type col, with the Month col as your
secondary sort key and the Date as the 3rd sort key.
Then do a Subtotal of the db, inserting a subtotal for each change in the
Month col.

If you do the above with you vb recorder turned on you will get the
necessary code to automate it ( probably with a little tweaking).
"Richard Buttrey" wrote:

I have a database consisting of several types of record, (each
identified with a unique code), and each record has a date field.

The database has a varying number of records in each month, i.e not
necessarily one for each day.

I need to be able to identify the last record of each month for each
type of record, and sum the various value fields of each record type
across a range of months.

Can anyone suggest an Excel formula, which could be put outside the
database in a summary table, which could achieve this?

Usual TIA

Rgds


__
Richard Buttrey
Grappenhall, Cheshire, UK
__________________________


__
Richard Buttrey
Grappenhall, Cheshire, UK
__________________________