+ Reply to Thread
Results 1 to 6 of 6

complex data transposing

Hybrid View

  1. #1
    Registered User
    Join Date
    11-21-2012
    Location
    Spain
    MS-Off Ver
    Excel Mac 2008
    Posts
    14

    complex data transposing

    Hi all,
    I'm rearranging a table and I am blocked. Please, help me. I don't know if what I want it's possible to do in Excel.

    I have a table with electoral results with this structure:

    City Party Results
    City 1 Party Z 30
    City 1 Party Y 20
    City 1 Party X 10
    City 2 Party Y 40
    City 2 Party Z 30
    City 2 Party X 12
    City 3 Party X 40
    City 3 Party Z 10
    City 3 Party Y 10

    And what I want to get is this:

    City Party X Party Y Party Z
    City 1 10 20 30
    City 2 12 40 30
    ... ... ... ...

    I have several problems I don't know how to resolve them.
    Original results are ordered first by city and then by party. But the parties are not in the same alphabetical order for each city, but ordered according to its result (high to low).

    What I want is only one row for each city, showing the results for each party. But the main problem I see is this different parties order for each city.

    Any suggestion about how to proceed?

    Thanks in anticipation!

    Frans

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,352

    Re: complex data transposing

    Hi Frans and welcome to the forum.

    This looks like you simply need to do a Pivot Table with your existing data. Use the City as Rows, Party as Columns and Result in the Values area.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Contributor bentleybob's Avatar
    Join Date
    02-27-2009
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2010
    Posts
    644

    Re: complex data transposing

    I'd use SUMIFS. Piece of cake. Upload a small sample file if you want to see how this would work.

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,352

    Re: complex data transposing

    Hi Guys,

    Here is the Pivot Table answer - Add your formulas and let's see the different ways of doing this problem.
    Attached Files Attached Files

  5. #5
    Forum Contributor bentleybob's Avatar
    Join Date
    02-27-2009
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2010
    Posts
    644

    Re: complex data transposing

    Here's my version, using formulas.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    11-21-2012
    Location
    Spain
    MS-Off Ver
    Excel Mac 2008
    Posts
    14

    Re: complex data transposing

    Pivot tables, yes!
    Thank you MarvinP. I was very obfuscated, working with Google Refine and Excel. And the solution was so simple!
    bentleybob, thank you for your suggestion too. For my case, pivot tables is a simpler solution.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1