Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Freezerbird
 
Posts: n/a
Default Converting data to list format


I believe that to analyse my data using pivot tables and pivot charts,
my raw data must be formatted as a "list". Unfortunately it isn't. Can
anyone help me to reorganise it please?

I'm analysing sales data for several products, by monthly sales over
three years. The data is sent to me in the following format: the column
headers are product, year, sales in Jan, sales in Feb, sales in Mar.....
sales in Dec. I want a pivot chart with the product in the page field,
sales figures up the side and months along the bottom, with a different
line (data series) for each year. I think to do this I need to convert
my data so that the columns headers are product, year, month and sales,
and apply the pivot table to that.

How can I quickly transfer the sales figures in the columns "Jan
sales", "Feb sales" etc so that they each appear on a separate row that
states the month in one column and the sales for that month in another?
Do I actually need to do it like this?

Any help gratefully received!


--
Freezerbird
------------------------------------------------------------------------
Freezerbird's Profile: http://www.excelforum.com/member.php...o&userid=35286
View this thread: http://www.excelforum.com/showthread...hreadid=550706

  #2   Report Post  
Posted to microsoft.public.excel.misc
Miguel Zapico
 
Posts: n/a
Default Converting data to list format

You may use a macro like this:

Sub MakeList()
Dim rngTable, rngList As Range
Dim i, j, k

'Change the ranges to reflect the correct data origin and destiny
Set rngTable = Worksheets("Sheet1").Range("A1").CurrentRegion
Set rngList = Worksheets("Sheet2").Range("A1")
k = 1

'Loop over the origin table, writing in the destination list
With rngTable
'First number is a two because of the headers
For i = 2 To .Rows.Count
'First number is a 3, the column where the data begins. Change
if appropiate
For j = 3 To .Columns.Count
rngList.Offset(k, 0) = .Cells(i, 1).Value
rngList.Offset(k, 1) = .Cells(i, 2).Value
rngList.Offset(k, 2) = .Cells(1, j).Value
rngList.Offset(k, 3) = .Cells(i, j).Value
k = k + 1
Next
Next
End With
End Sub

Change the ranges and the FOR clauses as appropiate for your data.

Hope this helps,
Miguel.


"Freezerbird" wrote:


I believe that to analyse my data using pivot tables and pivot charts,
my raw data must be formatted as a "list". Unfortunately it isn't. Can
anyone help me to reorganise it please?

I'm analysing sales data for several products, by monthly sales over
three years. The data is sent to me in the following format: the column
headers are product, year, sales in Jan, sales in Feb, sales in Mar.....
sales in Dec. I want a pivot chart with the product in the page field,
sales figures up the side and months along the bottom, with a different
line (data series) for each year. I think to do this I need to convert
my data so that the columns headers are product, year, month and sales,
and apply the pivot table to that.

How can I quickly transfer the sales figures in the columns "Jan
sales", "Feb sales" etc so that they each appear on a separate row that
states the month in one column and the sales for that month in another?
Do I actually need to do it like this?

Any help gratefully received!


--
Freezerbird
------------------------------------------------------------------------
Freezerbird's Profile: http://www.excelforum.com/member.php...o&userid=35286
View this thread: http://www.excelforum.com/showthread...hreadid=550706


  #3   Report Post  
Posted to microsoft.public.excel.misc
Freezerbird
 
Posts: n/a
Default Converting data to list format


Thanks very much, that works a treat!


--
Freezerbird
------------------------------------------------------------------------
Freezerbird's Profile: http://www.excelforum.com/member.php...o&userid=35286
View this thread: http://www.excelforum.com/showthread...hreadid=550706

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Accessing List Data quag2000 Excel Discussion (Misc queries) 1 May 12th 06 09:14 PM
How can I average data from a repeating list into a unique list? Duke Carey Excel Worksheet Functions 0 March 3rd 06 06:38 PM
named range, data validation: list non-selected items, and new added items KR Excel Discussion (Misc queries) 1 June 24th 05 05:21 AM
Converting a large vertical mailing list into a horizontal format Kevin VanHalen New Users to Excel 1 April 30th 05 12:23 PM
subtotaling and manipulating a list of data TJN Excel Worksheet Functions 0 April 27th 05 10:31 PM


All times are GMT +1. The time now is 07:12 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"