View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Frank Kabel Frank Kabel is offline
external usenet poster
 
Posts: 3,885
Default Multi-row data to single line data

Hi
have a look at pivot tables. See
http://www.cpearson.com/excel/pivots.htm
http://peltiertech.com/Excel/Pivots/pivotstart.htm
http://www.contextures.com/xlPivot02.html
http://www.ozgrid.com/Excel/excel-pivot-tables.htm

--
Regards
Frank Kabel
Frankfurt, Germany

"Leahs_Dad" schrieb im Newsbeitrag
om...
Looking for some help or suggestions on putting together an efficient
macro.

I regularly get multi-row data that is one line per response per
respondent.
The data is usually setup with the ID number followed by the question
label followed by the actual data.

Here is an example:

ID Field Value
1 VAL1 1
1 VAL2 22
1 VAL3 4
1 VAL4 10
2 VAL1 3
2 VAL3 8
2 VAL4 30

I need it converted to this:

ID VAL1 VAL2 VAL3 VAL4
1 1 22 4 10
2 3 8 30

I currently do it with another table and VLOOKUP but am looking for
something a little easier and safer. (There is always the problem of
the named ranges changing giving wrong results). Plus with a large
number of different fields naming the ranges alone can be time
consuming.

I have been looking in all the groups for a while for someone with a
similar request but have not found any.

Thanks in advance for any help or suggestions.

Tom

"Madness takes its toll... Please have exact change"