Converting a large Excel matrix to rows for upload into Access.

Tyler Durdin

New Member
Joined
May 29, 2017
Messages
3
I have a table of data in Excel with around 1,500 columns and around the same number of rows and I'd like to transfer the data into Access for further calculations. Excel is struggling to cope given the size of the data set.

I cannot reference the table directly from within Access because of Access's column limit. The source data needs to stay in Excel because it's the output of a number of other files/models which write directly into Excel.

A complicating factor is the number of records. If I convert the data into row format (from row and column format) to upload into access there will be around 2.25 million rows i.e. too large for a single Excel worksheet. Hence I have to split the data across multiple Excel worksheets, use lookup formulas to transform the data, then upload into access one by one. Obviously this is a laborious process.

Here is the current format :

DestD1D1D1D2D2
SiteQualityQ1Q2Q3D1Q2
S1Q10.260.740.480.110.58
S1Q20.450.540.570.750.47
S1
Q30.750.990.240.670.26
S2Q10.2680.980.360.290.71
S2Q20.870.390.740.540.28
S2Q30.470.140.730.370.88

<tbody>
</tbody>

And here is the desired format:


SiteSiteQDestDestQRate
S1Q1D1Q10.26
S1Q1D1Q20.74
S1Q1D1Q30.48

<tbody>
</tbody>

etc.

Can anyone a) tell me the best format to convert the data to, (I'm assuming csv but Excel can't hold 2.25 million rows then convert to csv) and b) suggest a way of doing this with vba ?

Any advice will be greatly appreciated.

JC.
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
I wonder whether you might use PowerQuery and load the data into the datamodel rather than into Excel and use Powerpivot to do your calculations?
 
Upvote 0
Hi Jan and thanks for your suggestion. I've recently started experimenting with Power Query and I love the unpivot function. However, I haven't been able to find a way of using it to 'unpivot' based on 2 header rows. I could concatentate the data but it will add time and make subsequent manipulation difficult. Can you suggest a method within power query of achieving this, or suggest somewhere I can start looking ?
 
Upvote 0

Forum statistics

Threads
1,215,563
Messages
6,125,565
Members
449,237
Latest member
Chase S

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