Adding COUNT to records

Status
Not open for further replies.

abesimpson

Active Member
Joined
May 3, 2003
Messages
432
I import a text file of several million records into Access every month .
Each record has a date field, and a value field. The database is sorted first on date, then on value. Each date has many values, but there is no fixed number of records per date.

The sorted database looks like this:
Date1, Value1
Date1, Value2
Date1, Value3
Date1, Value4
Date2, Value1
Date2, Value2
Date2, Value3
Date3, Value1
Date3, Value2
Date4, Value1
etc.

I need to add a count per record, to get this:,
Date1, Value1, Count1
Date1, Value2, Count2
Date1, Value3, Count3
Date1, Value4, Count4
Date2, Value1, Count1
Date2, Value2, Count2
Date2, Value3, Count3
Date3, Value1, Count1
Date3, Value2, Count2
Date4, Value1, Count1
etc


I habve NO idea how to do this. Any help will be appreciated.

abe
 

Some videos you may like

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Status
Not open for further replies.

Watch MrExcel Video

Forum statistics

Threads
1,123,492
Messages
5,601,994
Members
414,490
Latest member
Rip181

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top