Share via

Transposing Columns to Rows Issue

Anonymous
2022-11-29T00:42:47+00:00

I have an issue with an Excel sheet for an election in which one column lists the candidates, districts and parties, and another lists the vote totals for each. But, what I need is for it to list the districts once by numbers with the other columns being the vote totals for each candidate.

The issue I'm having is that it's not just the two major parties, but sometimes a third party or more will run in a district. So, is there a formula to transpose all of this so that it matches votes totals with the party candidates even when it's not just alternating once for each district? Does this question make sense? I'm not sure why the state sets up the data the way they do.

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Andreas Killer 144.1K Reputation points Volunteer Moderator
2022-11-30T08:07:52+00:00

Take a look into this file, column A:C are random generated.

https://1drv.ms/x/s!AsEpmlJLteasjjTPkE6nMnHAqfym?e=ET1S1e

Andreas.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

Answer accepted by question author

Anonymous
2022-11-30T07:53:18+00:00

https://support.microsoft.com/en-us/office/create-a-pivottable-to-analyze-worksheet-data-a9a84538-bfe9-40a9-a8e9-f99134456576

Drag the "Party Description" field into the columns section.

just like drag year in the video。

I am using sql

select * from basic_two_dim_Transposing_Columns_to_Rows;

cli_create_two_dim~basic_two_dim_Transposing_Columns_to_Rows~PartyDescription~CandidateVotes;

select * from basic_two_dim_Transposing_Columns_to_Rows_two_dim;

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

8 additional answers

Sort by: Most helpful
  1. Andreas Killer 144.1K Reputation points Volunteer Moderator
    2022-11-29T05:01:20+00:00

    Did you tried to create a Pivot table?

    Create a PivotTable to analyze worksheet data - Office Support

    If you need further help we need a sample file.

    At best make a copy of your original file and anonymize the necessary data. For this please download this file
    https://www.dropbox.com/s/rkfxuh85j5wyj9y/modAnonymize.bas?dl=1
    Open your Excel file
    Right-click on the sheet tab
    Choose "View Code"
    Press CTRL-M
    Select the downloaded file and import
    Close the VBA editor
    Select the cells with the confidential data
    Press Alt-F8
    Choose the macro Anonymize
    Click Run

    Upload it on OneDrive (or an other Online File Hoster of your choice) and post the download link here.
    https://support.office.com/en-us/article/Share-OneDrive-files-and-folders-9fcc2f7d-de0c-4cec-93b0-a82024800c07

    Then we can look at the file and try to find a solution. Thank you for your understanding.

    Andreas.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  2. Andreas Killer 144.1K Reputation points Volunteer Moderator
    2022-11-29T11:09:34+00:00

    What I need is for the "Party Description"s to be their own column with the "Candidate Votes" listed down each respectively, so that the only rows are the "Office Description"s.

    Drag the "Party Description" field into the columns section.

    Andreas.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2022-11-29T10:16:24+00:00

    I'm using Microsoft Office available through Outlook.com. There is no "view code" when I right-click on the sheet tab.

    Anyway, here's what I have from the Pivot Table thus far:

    What I need is for the "Party Description"s to be their own column with the "Candidate Votes" listed down each respectively, so that the only rows are the "Office Description"s.

    Was this answer helpful?

    0 comments No comments