Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 155413
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T10:09:05+00:00 2026-05-11T10:09:05+00:00

I have a two dimensional table with countries and years in Excel. eg. 1961

  • 0

I have a two dimensional table with countries and years in Excel. eg.

        1961        1962        1963        1964 USA      a           x            g           y France   u           e            h           a Germany  o           x            n           p 

I’d like to ‘flatten’ it, such that I have Country in the first col, Year in the second col, and then value in the third col. eg.

Country      Year       Value USA          1961       a USA          1962       x USA          1963       g USA          1964       y France       1961       u               ... 

The example I present here is only a 3×4 matrix, but the real dataset i have is significantly larger (roughly 50×40 or so).

Any suggestions how I can do this using Excel?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T10:09:06+00:00Added an answer on May 11, 2026 at 10:09 am

    You can use the excel pivot table feature to reverse a pivot table (which is essentially what you have here):

    Good instructions here:

    http://spreadsheetpage.com/index.php/tip/creating_a_database_table_from_a_summary_table/

    Which links to the following VBA code (put it in a module) if you don’t want to follow the instructions by hand:

    Sub ReversePivotTable() '   Before running this, make sure you have a summary table with column headers. '   The output table will have three columns.     Dim SummaryTable As Range, OutputRange As Range     Dim OutRow As Long     Dim r As Long, c As Long      On Error Resume Next     Set SummaryTable = ActiveCell.CurrentRegion     If SummaryTable.Count = 1 Or SummaryTable.Rows.Count < 3 Then         MsgBox 'Select a cell within the summary table.', vbCritical         Exit Sub     End If     SummaryTable.Select     Set OutputRange = Application.InputBox(prompt:='Select a cell for the 3-column output', Type:=8) '   Convert the range     OutRow = 2     Application.ScreenUpdating = False     OutputRange.Range('A1:C3') = Array('Column1', 'Column2', 'Column3')     For r = 2 To SummaryTable.Rows.Count         For c = 2 To SummaryTable.Columns.Count             OutputRange.Cells(OutRow, 1) = SummaryTable.Cells(r, 1)             OutputRange.Cells(OutRow, 2) = SummaryTable.Cells(1, c)             OutputRange.Cells(OutRow, 3) = SummaryTable.Cells(r, c)             OutputRange.Cells(OutRow, 3).NumberFormat = SummaryTable.Cells(r, c).NumberFormat             OutRow = OutRow + 1         Next c     Next r End Sub 

    -Adam

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a two dimensional table in Excel. eg. outputproduct blending combination **5 P1:0.6/P3:0.5**
I have a two-dimensional array (of Strings) which make up my data table (of
I have a two dimensional list and a one dimensional list. I would like
I have a two-dimensional array. When I print/dump this I get the following My
I have a two dimensional JSON array where each element contains several attributes. The
I have a two dimensional ArrayList that I need to filter the duplicates out
I have a two dimensional array with the following output Array ( [0] =>
I have a two dimensional array public class TwoDimensions { public static void main(String[]
I have the following as two ways to declare a two dimensional String array.
I have a database full of two-dimensional data - points on a map. Each

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.