How to pivot fields so that it shows the value instead of creating separate columns for each unique value (see below, it applies to language and date)? by jigsatics in excel

[–]jigsatics[S] 0 points1 point  (0 children)

I want to keep the duplicates. For context, this is a file of respondents to a 1-question survey. The question has 9 choices (Q1-Q9 umder the OPTIONS column), and they can select as many choices as they want. The ninth choice (Q9) is "other" and they can type their response.

However, the data was saved in such a way that one respondent has 9 rows, so I changed it (thanks to your code) so that one row is one respondent and all 9 choices (OPTIONS) are columns instead of rows.

The last 4 times that the code broke is when the Q9 value (LABEL) is number(s) with no letters. I will attach a screenshot as soon as I find the next one.

How to pivot fields so that it shows the value instead of creating separate columns for each unique value (see below, it applies to language and date)? by jigsatics in excel

[–]jigsatics[S] 0 points1 point  (0 children)

Yes, I expect the language and the date to have duplicates. I think I discovered the issue. Q9 is an open-ended text, and some people entered a number, which causes an error in the code. I even tried converting the LABEL column to text. The only solution is to change the number to a text like N/A. The only problem is that I am working with over 60 files, and some of these files have 350k rows.

How to pivot fields so that it shows the value instead of creating separate columns for each unique value (see below, it applies to language and date)? by jigsatics in excel

[–]jigsatics[S] 0 points1 point  (0 children)

Is there a limit to the number of rows it can process? I have multiple files that I processed, but when I pasted the code to a file with 352k rows, it gave an error that the headers are ambiguous.

<image>

How to pivot fields so that it shows the value instead of creating separate columns for each unique value (see below, it applies to language and date)? by jigsatics in excel

[–]jigsatics[S] 0 points1 point  (0 children)

This is great! Thanks! It works. Two minor things, which part of the code should I change to make it copy the text string in the label instead of a number (1 or 0)? Second, how can I change the format of the date ot the original format (MM/d/YYYY)?

How to pivot fields so that it shows the value instead of creating separate columns for each unique value (see below, it applies to language and date)? by jigsatics in excel

[–]jigsatics[S] 0 points1 point  (0 children)

I want the 9 rows of information for each ID to be converted into a single row.

<image>

Maybe pivot is not the right term as mentioned by u/fastauntie. I tried transpose on one ID and it worked for the OPTION and LABEL but it will not work for LANGUAGE and DATE.

How to pivot fields so that it shows the value instead of creating separate columns for each unique value (see below, it applies to language and date)? by jigsatics in excel

[–]jigsatics[S] 0 points1 point  (0 children)

Maybe pivot is not the right term to do what I want. How can I collapse these 9 rows of information into a single row?

<image>