Convert columns with multiple rows of data to rows with multiple columns in Excel.

前端 未结 4 1649
广开言路
广开言路 2021-01-24 19:26

I have data organised in cloumns with multiple rows which I need to convert to rows with multiple columns for data analysis. For example,

    ID  Date of entry          


        
4条回答
  •  广开言路
    2021-01-24 19:41

    I started from a formula I found on the internet that takes one-column list and changes it's layout to multyple columns: that insteat of 1000+ rows you'll get 60 rows with many columns of that list. you can find it here http://help.lockergnome.com/office/list-multiple-columns-page--ftopict935389.html

    i wanted to take a list that has 4 columns (the 5th column is empty) and 1000+ rows, and make it a 50 rows table that the 4 fields repeats itself.

    for example i have:

    family  |  name   |  amount  |   table |
    fam1    |  shlomi |  2       |   38    |
    fam2    |  hila   |  4       |   23    |    
    ....    
    fam1000 |  avi    |  1       |   15    |
    

    and i want to make it

    family  |  name   |  amount  |   table |     |fam50    |  ben   |  2       |   68    |  ...    
    fam1    |  shlomi |  2       |   38    |      ...    
    fam2    |  hila   |  4       |   23    |      ...    
    ...                                           ...    
    fam49   |  dror   |  1       |   15    |     |fam99    |  dror   |  1      |   15    | ...
    

    On a new worksheet in your existing workbook, insert the following formula into A1:

    =IF(OFFSET(Sheet1!$A$1,QUOTIENT(COLUMN(),5)*50+ROW()-1,MOD(COLUMN()-1,5))="","",OFFSET(Sheet1!$A$1,QUOTIENT(COLUMN(),5)*50+ROW()-1,MOD(COLUMN()-1,5)))

    .. Copy this formula across as many columns as you need, and as many rows as you need ( I used 50 in my example)

    You can change '5' in the furmula to the number of fields you want in each column layout, and you can change '50' to the number of rows you want in each page.

提交回复
热议问题