I am using Microsoft Office Excel 2007 and Windows 7.
I have a lot of data (1-4 thousands of rows) where each column represents a year for 15 years. Every set of 5 rows are different data for a company and the values for every year of each data are under the representative column.
I want to transpose the values for every year, of one data at a time, into one column. Then do the same for the next data.
For Example I have something like this:
<tbody>
</tbody>
And I want to make it into like this:
<tbody>
</tbody>
Sorry for the big example. If there is a way to do this for one data (i.e. data1) it will be easy to do it for the other 4. I also know how to create a macro from the Developer Tab if it is easier to create a vba code. A formula of course is ok too. I tried for hours to find a way to do this but I couldn't...
Thank you very much for your help,
Nataly.
I have a lot of data (1-4 thousands of rows) where each column represents a year for 15 years. Every set of 5 rows are different data for a company and the values for every year of each data are under the representative column.
I want to transpose the values for every year, of one data at a time, into one column. Then do the same for the next data.
For Example I have something like this:
1998 | 1999 | 2000 | 2001 | 2002 | 2003 | 2004 | 2005 | 2006 | 2007 | 2008 | 2009 | 2010 | 2011 | 2012 | |
comp.1data1 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
comp.1data2 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 |
comp.1data3 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 |
comp.1data4 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 |
comp.1data5 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 |
comp.2data1 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 |
comp.2data2 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 |
comp.2data3 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 |
comp.2data4 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 |
comp.2data5 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 |
comp.3data1 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 |
comp.3data2 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 |
comp.3data3 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 |
comp.3data4 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 |
comp.3data5 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 |
<tbody>
</tbody>
And I want to make it into like this:
data1 | data2 | data3 | data4 | data5 |
1 | 16 | 31 | 46 | 61 |
2 | 17 | 32 | 47 | 62 |
3 | 18 | 33 | 48 | 63 |
4 | 19 | 34 | 49 | 64 |
5 | 20 | 35 | 50 | 65 |
6 | 21 | 36 | 51 | 66 |
7 | 22 | 37 | 52 | 67 |
8 | 23 | 38 | 53 | 68 |
9 | 24 | 39 | 54 | 69 |
10 | 25 | 40 | 55 | 70 |
11 | 26 | 41 | 56 | 71 |
12 | 27 | 42 | 57 | 72 |
13 | 28 | 43 | 58 | 73 |
14 | 29 | 44 | 59 | 74 |
15 | 30 | 45 | 60 | 75 |
76 | 91 | 106 | 121 | 136 |
77 | 92 | 107 | 122 | 137 |
78 | 93 | 108 | 123 | 138 |
79 | 94 | 109 | 124 | 139 |
80 | 95 | 110 | 125 | 140 |
81 | 96 | 111 | 126 | 141 |
82 | 97 | 112 | 127 | 142 |
83 | 98 | 113 | 128 | 143 |
84 | 99 | 114 | 129 | 144 |
85 | 100 | 115 | 130 | 145 |
86 | 101 | 116 | 131 | 146 |
87 | 102 | 117 | 132 | 147 |
88 | 103 | 118 | 133 | 148 |
89 | 104 | 119 | 134 | 149 |
90 | 105 | 120 | 135 | 150 |
151 | 166 | 181 | 196 | 211 |
152 | 167 | 182 | 197 | 212 |
153 | 168 | 183 | 198 | 213 |
154 | 169 | 184 | 199 | 214 |
155 | 170 | 185 | 200 | 215 |
156 | 171 | 186 | 201 | 216 |
157 | 172 | 187 | 202 | 217 |
158 | 173 | 188 | 203 | 218 |
159 | 174 | 189 | 204 | 219 |
160 | 175 | 190 | 205 | 220 |
161 | 176 | 191 | 206 | 221 |
162 | 177 | 192 | 207 | 222 |
163 | 178 | 193 | 208 | 223 |
164 | 179 | 194 | 209 | 224 |
165 | 180 | 195 | 210 | 225 |
<tbody>
</tbody>
Sorry for the big example. If there is a way to do this for one data (i.e. data1) it will be easy to do it for the other 4. I also know how to create a macro from the Developer Tab if it is easier to create a vba code. A formula of course is ok too. I tried for hours to find a way to do this but I couldn't...
Thank you very much for your help,
Nataly.