Super User is a question and answer site for computer enthusiasts and power users. 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 an Excel document that looks like this:

Country       Property   Value 
Canada        Capital    Ottawa 
Canada        Population 38 
Canada        Language1  French 
Canada        Language2  English 
United States Capital    Washington  
United States Population 280 
United States Language1  English 
United States Language2  NA

I want to re-arrange this so that it looks like this:

Country         Capital     Population Language1 Language2
Canada          Ottawa      38         French    English
United States   Washington  280        English   NA

Is there any way to do this transformation ? Thanks.

share|improve this question

Note: Assuming the first table with columns Country, Property and Value is stored in Sheet1.

  1. Create a new sheet with columns Country, Capital, Population, Language1, Language2
  2. Populate the first column with distinct countries
    1. Copy all countries from Sheet1
    2. Use the delete duplicate value function
  3. Enter the array formula below into cell B2 in the new sheet. Remember to use Ctrl + Shift + Enter when entering the formula to make it an array formula (noticable by the curly brackets)
  4. Copy/paste the formula from B2 to the remaining cells


(The formula retrieves the first row number of the source data matching both country and property name, and then use the offset function to retrieve the property value from that row)

share|improve this answer

I think the formula may actually be...

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .