RE: Finding last record in month for each of several types of record.



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
> __________________________
>
.