Calculating count of 1st occurrence of ACV value in crosstab rows containing variable date headings

sifar786

New Member
Joined
Aug 9, 2008
Messages
15
Hi,

I have multiple crosstab workbooks like this, each representing ACV data for a particular Category-Country e.g. Foods-US. The workbooks filenames are e.g.

  • INO-Food-US.xlsx
  • INO-Pet Food-US.xlsx
  • INO-CCare-US.xlsx
  • INO-CCare-UK.xlsx
  • INO-Food-UK

etc.
i can loop thru the folder and import all these workbooks (each containing a single sheet of crosstab data), but i am finding it difficulty to analyse this huge crosstab data as i have never worked with crosstabs before.

i tried Unpivoting it or UNION ALL, but there are > 166 "Week ending dd/mm/yy" columns, depending upon how many years data is contained in that workbook! Also in some workbooks some weeks may be missing (no data for that week). Below is a snapshot of it imported into Access as a table:

Crosstab data imported into Access for Analysis
s!Am1wNPJDit1whyEyTg8uCNk79tbr


if you see the 1st column, it has values separated by "-". i want to split this column into 3 NEW columns using the "-" as delimiter, e.g.
ASDA DIET - LINE EXTENSION - 2012/03/02

will go into 3 columns viz.,

BRANDTYPERECDATE
ASDA DIETLINE EXTENSION2012/03/02

<tbody>
</tbody>


  1. RECDATE is un-important.
  2. but even if the TYPE is kept i.e. a single column (instead of 3 columns), that will also help to aggregate just on the TYPE column.
  3. I want to loop thru all these workbooks and pull this data into a recordset, one at a time. (this is done)
  4. then run a query on this recordset to count the 1st occurrence of ACV value in each BRAND/TYPE row.
  5. Then get a count of the 1st OCCURRENCE OF ACV values for each BRAND or TYPE in a YEAR.
  6. if NA is shown it means "No Data Available" or that BRAND/TYPE "Did not Exist" till those dates, where NA was shown in their columns.

The resultant table should somewhat look like this, where their ACV values should show as column headings and their values as their Counts, for each BRAND or TYPE for that Year e.g 2010:

Output table
s!Am1wNPJDit1whyCxuQqGU3FIB__x


could someone who has worked with such Crosstabs help quickly?​




 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

Forum statistics

Threads
1,214,915
Messages
6,122,214
Members
449,074
Latest member
cancansova

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
Back
Top