An improperly constructed table

cmcreynolds

Active Member
Joined
May 21, 2015
Messages
295
I was just handed an Excel file with "tables" within it, however, there is no database structure to it - it is basically just a ledger - months at the top, but above that headers "merged and centered"; Categories and Subcategories on the left. I'm supposed to link (via Power Query) this data to another report and it's just impossible in the current format.

Before I start the mind-numbing process of converting this manually, is there a way for Excel (or another program) to convert this to a database table? :( (I'm preparing/fearing the response is "spend the next few days copying and pasting") :eek:

Thank you.
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
:( (I'm preparing/fearing the response is "spend the next few days copying and pasting") :eek:

Certainly not. You can use formulas, VBA, the reverse pivot table with concatenate operators, a union query in SQL/MS Query/Power Query. Can you post the structure?
 
Upvote 0
Welcome to the Board!

We don't support file uploads here, but if you follow the HTML Maker link in my sig you'll be able to post a screen shot(s).
 
Upvote 0
So after running your picture through OCR and deleting rows/columns while repeating labels with F5(Goto):


Excel 2010
ABCDEFGHIJK
1JulyAugustSeptOctNovDecJanFeb
2LeadsAvg Conv
3Leads27%A5252525252525252
4Leads16%B17171717171788
5Leads7%C2929292929292929
6Leads7%D3131313131313131
7Leads18%E3636363636362424
8Leads18%F1141141141141141145757
9Leads12%G2828282828282828
10New EnrollmentProgram
11New EnrollmentA15815
12New EnrollmentB55
13New EnrollmentC105
14New EnrollmentD2212
15New EnrollmentE7310
16New EnrollmentF3535
17New EnrollmentG555
18Returning StudentsA304008
19Returning StudentsB130120018
20Returning StudentsC130200017
21Returning StudentsD890650067
22Returning StudentsE260330027
23Returning StudentsF360680054
24Returning StudentsG0080012
Sheet1 (2)


What is column B for? Do you need it? If so, then keep the labels, concatenate, and alt-D, P unpivot (the full process can be seen here: https://www.youtube.com/watch?v=xmqTN0X-AgY) you'll have the datasheet.
 
Upvote 0
Thank you very much - Column B could probably be deleted. Thanks for the link to the video. I "hoped" it could be done easily.

Cheers-

Clifton
 
Upvote 0
Well this macro I posted last week for a similar problem helps: http://www.mrexcel.com/forum/excel-questions/859948-conditional-transpose.html (#6)

Deleting Col B, filling the blanks with zeroes using F5-special-blanks-(type a formula to fill group names or zero to change blanks to zero)-ctrl-enter:


Excel 2010
ABCDEFGHIJ
1GroupNameJulyAugustSeptOctNovDecJanFeb
2LeadsA5252525252525252
3LeadsB17171717171788
4LeadsC2929292929292929
5LeadsD3131313131313131
6LeadsE3636363636362424
7LeadsF1141141141141141145757
8LeadsG2828282828282828
9New EnrollmentA0150800150
10New EnrollmentB05000050
11New EnrollmentC010000050
12New EnrollmentD020200120
13New EnrollmentE070300100
14New EnrollmentF0350000350
15New EnrollmentG05050050
16Returning StudentsA03040080
17Returning StudentsB01301200180
18Returning StudentsC01302000170
19Returning StudentsD08906500670
20Returning StudentsE02603300270
21Returning StudentsF03606800540
22Returning StudentsG000800120
Sheet1 (3)


then running the macro (rename the sheet "Source" first):


Excel 2010
ABCD
1GroupNameMonthValue
2LeadsAJuly52
3LeadsAAugust52
4LeadsASept52
5LeadsAOct52
6LeadsANov52
7LeadsADec52
8LeadsAJan52
9LeadsAFeb52
10LeadsBJuly17
11LeadsBAugust17
12LeadsBSept17
13LeadsBOct17
14LeadsBNov17
15LeadsBDec17
16LeadsBJan8
17LeadsBFeb8
18LeadsCJuly29
19LeadsCAugust29
20LeadsCSept29
21LeadsCOct29
22LeadsCNov29
23LeadsCDec29
24LeadsCJan29
25LeadsCFeb29
26LeadsDJuly31
27LeadsDAugust31
28LeadsDSept31
29LeadsDOct31
30LeadsDNov31
31LeadsDDec31
32LeadsDJan31
33LeadsDFeb31
34LeadsEJuly36
35LeadsEAugust36
36LeadsESept36
37LeadsEOct36
38LeadsENov36
39LeadsEDec36
40LeadsEJan24
41LeadsEFeb24
42LeadsFJuly114
43LeadsFAugust114
44LeadsFSept114
45LeadsFOct114
46LeadsFNov114
47LeadsFDec114
48LeadsFJan57
49LeadsFFeb57
50LeadsGJuly28
Sheet3


(the HTML poster only allows 50 rows but you get the idea)
 
Upvote 0
Great - this is starting to get me somewhere. The person who created these went just for visual layout and not for any type of database usage. So, there are thirteen tabs with all this data. My goal is to combine them all into one data table, then use pivot tables and slicers (since the tabs will never be compared to one another, I think slicers would be much easier to manipulate).

Anyway, I'm progressing - even with a horrible sinus headache this morning. :)

Thank you very much.
 
Upvote 0
Is there a way to make Leads a column, New Enrollments a column (field), Returning Students a column, etc.?
 
Upvote 0

Forum statistics

Threads
1,214,406
Messages
6,119,330
Members
448,888
Latest member
Arle8907

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