Web Applications Stack Exchange is a question and answer site for power users of web applications. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a table which looks like this:

   A     B      C    D  
1 red   blue  green white  
2 blue  red   white yellow
3 red   blue  green white  
4 red   blue  green white 

and would like to get a result like this:

col1 col2 col3
1     A    red
1     B    blue
1     C    green
3     A    red
3     B    blue

It is kind of the opposite of the creation of a pivot table.

Is there any way on how do this with a function or plugin in Google Spreadsheet?

share|improve this question

migrated from stackoverflow.com Nov 4 '13 at 1:26

This question came from our site for professional and enthusiast programmers.

Assuming the data is in four columns, seed F1 and G1 with 1 and A respectively, enter in H1:


in F2:


in G2:


and copy all formulae down to suit.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.