• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member
  • Login

Join Excel sheets with combined headers|Power Query|Excel Forum|My Online Training Hub

You are here: Home / Join Excel sheets with combined headers|Power Query|Excel Forum|My Online Training Hub
Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search
Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search Search
sp_RankInfo
Lost password?
sp_CrumbsHome HomeExcel ForumPower QueryJoin Excel sheets with combined hea…
sp_PrintTopic sp_TopicIcon
Join Excel sheets with combined headers
Avatar
Juan Aguero
Paraguay
Member
Members
Level 0
Forum Posts: 11
Member Since:
June 29, 2013
sp_UserOfflineSmall Offline
1
October 16, 2018 - 3:44 am
sp_Permalink sp_Print

Hello!

I have a spreadsheet with two sheets. Each sheet has monthly and yearly fuel import information for 2 years (total: 4 years) by company. The header of the sheets have combined cells (month/year and FOB US/Net Kg.)

Each company can import more than a type of fuel, that's why the name of a company can be repeated.

Is it possible to join the two sheets, eliminate yearly data and join all monthly FOB US columns together and all monthly Net Kg together?

Thank you very much for your ideas

Best regards,

Juan

sp_AnswersTopicSeeAnswer See Answer
Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4614
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
2
October 16, 2018 - 11:31 am
sp_Permalink sp_Print

Hi Juan,

Probably, but it's difficult to say without seeing a sample file or images. e.g. you say there are two sheets, but I don't know what each sheet represents...a different company? Also, you mention "Each company can import more than a type of fuel, that's why the name of a company can be repeated", repeated where?

A picture or sample file will tell a thousand words 🙂

Mynda

Avatar
Juan Aguero
Paraguay
Member
Members
Level 0
Forum Posts: 11
Member Since:
June 29, 2013
sp_UserOfflineSmall Offline
3
October 16, 2018 - 9:59 pm
sp_Permalink sp_Print

Hello Mynda,

Thank you very much for your valuable support.

I thought that I uploaded a sample file, but I see I didn't. Here is an attachment of a sample file.

Kind regards,

Juan

Avatar
Alan Sidman
Steamboat Springs, CO
Member
Members


Trusted Members
Level 0
Forum Posts: 174
Member Since:
October 18, 2018
sp_UserOfflineSmall Offline
4
October 18, 2018 - 1:41 pm
sp_Permalink sp_Print

 join all monthly FOB US columns together and all monthly Net Kg together?

 

Show us what you mean by this statement.  An example for just one of the companies 

Avatar
Juan Aguero
Paraguay
Member
Members
Level 0
Forum Posts: 11
Member Since:
June 29, 2013
sp_UserOfflineSmall Offline
5
October 18, 2018 - 10:31 pm
sp_Permalink sp_Print

Hello Alan, 

Thank you very much for your reply.

Here is a sample of the table I would like to achieve. See "Final" sheet.

Best regards

Juan

Avatar
Alan Sidman
Steamboat Springs, CO
Member
Members


Trusted Members
Level 0
Forum Posts: 174
Member Since:
October 18, 2018
sp_UserOfflineSmall Offline
6
October 19, 2018 - 2:02 am
sp_Permalink sp_Print sp_EditHistory

An issue I have with your layout is that you have two header rows.  If you change your header rows to 

Jan 03 FOB US and Jan 03 Net kg, etc for each of the columns.  Then you can pivot the results in a pivot table.  I have done this for Jan and Feb of 05.  Fix up your tables and if you still need assistance, post back.  You can merge both tables into one pivot table.  

Delete the top header row and only use the newly formed header.

Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4614
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
7
October 19, 2018 - 9:39 am
sp_Permalink sp_Print

Hi Juan,

Thanks for providing the workbook and an example of the desired outcome. As Alan said, this makes it much clearer and we can be sure when we help that we fully understand.

In the attached file I've used Power Query to unpivot your data (see link for tutortial on unpivoting with Power Query). From there you can then append your two tables and create the desired PivotTable.

Note: in the attached file the final query (Append1) is loaded directly to the Data Model (Power Pivot) and from there the PivotTable was created.

Mynda

sp_AnswersTopicAnswer
Answers Post
Avatar
Juan Aguero
Paraguay
Member
Members
Level 0
Forum Posts: 11
Member Since:
June 29, 2013
sp_UserOfflineSmall Offline
8
October 19, 2018 - 10:30 pm
sp_Permalink sp_Print

Hello Mynda and Alan,

Thank you very much for your valuable insights, I really appreciate all your support.

What a fantastic tutorial, Mynda, the example 3 is exactly my case!. I will watch the video at home later (I have blocked Youtube at work) .

I have some questions:

1) Does Power Query unify the 2-row header into one?

2) When you created the Pivot table, did it group all FOB USD monthly columns and then all Net Kg monthly columns automatically?

I think I will need to delve into Power Query and Power Pivot, I am sure they will help me achieve results I have never imagined.

All the best,

Juan

Avatar
Juan Aguero
Paraguay
Member
Members
Level 0
Forum Posts: 11
Member Since:
June 29, 2013
sp_UserOfflineSmall Offline
9
October 19, 2018 - 10:43 pm
sp_Permalink sp_Print

Mynda, a curiosity, how much time did you take to do all the process and create the final Pivot table?

A coworker did the process manually and took him an entire afternoon to join the yearly tables and group all the columns by categories.

As he spent much time in the process, I decided to post a message to know if there is a more efficient way to do this in order to suggest him and fortunately, I am impressed to know it's possible SmileSurprised It's awesome!!

Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4614
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
10
October 20, 2018 - 9:02 pm
sp_Permalink sp_Print sp_EditHistory

Hi Juan,

Glad it helped. From memory it took me about 10 minutes to prepare your file. It probably took me longer than it should have because I wasn't familiar with your data.

To answer your other questions:

1. You merge the two headers after transposing so that they can be placed into one row.

2. I arranged the Columns so that the values were grouped (FOB and Net Kg.) together, you can see in the Column area in the PivotTable field pane the 'Values' is at the top of the list above Date (Year) and Date (month). You can drag them to change the grouping.

I have a Power Query course if you'd like to learn more.

Mynda

Avatar
Juan Aguero
Paraguay
Member
Members
Level 0
Forum Posts: 11
Member Since:
June 29, 2013
sp_UserOfflineSmall Offline
11
October 24, 2018 - 12:10 am
sp_Permalink sp_Print

Hello Mynda,

Thank you very much for your valuable support. It's awesome to know I took so little time to prepare the file, a great evidence the amount of time that can be saved by using the most efficient toolsSmile

I will be considering your Power Query Course, I am sure it will be a enriching experience! Hope the US dollar rate decreases a little soon.

Kind regards,

Juan

Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4614
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
12
October 24, 2018 - 10:54 am
sp_Permalink sp_Print

You're welcome. Maybe your employer will see the cost benefit to learning Power Query and will pay for your course 😉

Avatar
Juan Aguero
Paraguay
Member
Members
Level 0
Forum Posts: 11
Member Since:
June 29, 2013
sp_UserOfflineSmall Offline
13
October 24, 2018 - 8:51 pm
sp_Permalink sp_Print

I haven't considered that idea, Mynda, I think it's something possible, I will try Smile

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Martin Delloca, Tracy English
Guest(s) 9
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 880
Purfleet: 414
Frans Visser: 346
David_Ng: 306
lea cohen: 237
Jessica Stewart: 219
A.Maurizio: 213
Aye Mu: 201
jaryszek: 183
Newest Members:
Rob Rooth
Tom Lewis
Jennifer Rodriguez-Avila
Khaled Ibrahim
Kiran Supekar
Lisa Myers
Ronald White
Ginette Guevremont
Taryn Ambrosi
Mark Davenport
Forum Stats:
Groups: 3
Forums: 24
Topics: 6531
Posts: 28604

 

Member Stats:
Guest Posters: 49
Members: 32822
Moderators: 2
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: Velouria, Riny van Eekelen
© Simple:Press —sp_Information

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel Office Scripts
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook

Sign up to our newsletter and join over 400,000
others who learn Excel and Power BI with us.

 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate
  • Sponsor Our Newsletter

Support

  • Contact
  • Forum
  • Helpdesk - For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.