+ Reply to Thread
Results 1 to 4 of 4

Analysing sales data -pivot table novice

  1. #1
    Registered User
    Join Date
    07-05-2008
    Location
    Norwich, UK
    Posts
    9

    Analysing sales data -pivot table novice

    This is my first post on here, so hello to everybody and go easy on me!

    I have a worksheet containing aprox 3,500 rows of sales data covering a four year period. I want to use pivot tables to analyse this data. My experience of Excel is pretty basic- I am learning as I go a long at the moment and have never used pivot tables before. I am doing this as a favour for my Dad (data is from his Business) but also as I am interested in improving my Excel skills.

    My initial questions relate to the formating of my data. I have a feeling that the way it is setup currently doesn't lend it's self well to pivot table analysis:

    http://www.excelforum.com/attachment...1&d=1215250833

    So rather than a seperate row for each product sold, it is split per transaction. I.e if customer x puts an order in for 5 products, those 5 products are currently shown on the same row, but split into a seperate collumn (under collumn headings: product 1, product 2 etc). These headings stretch from Collumn P - Collumn AC (highest order = 14 products)

    Will this style cause me problems when creating pivot tables?
    Should each product sold be shown on a seperate row?
    If so, what's the easiest way achieve this?
    There are 31 products - should the product i.d. be numeric?
    Any other advice on how best to format the data?


    Thanks in advance for your help.
    Attached Images Attached Images

  2. #2
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Hi plainlazy84,

    Welcome to the forum, take a look at these links on how set set up your data and perform pivot tables

    http://office.microsoft.com/en-gb/ex...346321033.aspx

    http://www.datapigtechnologies.com/ExcelMain.htm
    oldchippy
    -------------


    Blessed are those who can give without remembering and take without forgetting

    If you are happy with the help you have received, please click the <--- STAR icon on the left - Thanks.

    Click here >>> Top Excel links for beginners to Experts

    Forum Rules >>>Please don't forget to read these

  3. #3
    Registered User
    Join Date
    07-05-2008
    Location
    Norwich, UK
    Posts
    9
    Thanks for the links. I have read them both but neither answers my specific question. They did give me some good background info though.

    I will narrow it down this time as perhaps I was asking a bit too much in my initial post. Attached is dummy data with how it currently looks and how I would like it.

    Collumn P contains product code(s) for each unit sold per transaction. When multiple products are sold they are separated in the same cell by a comma.

    I would like a new row to be created every time a cell contains more than one product code. The data in collums A-O would also need to be copied down into these newly created rows.

    Lastly there is also the problem of dividing the amount in col' L between multiple products from the same transaction. I'm prepared to lose this collumn altogether and simply analyse the data on units sold if there is no easy way to do this. Suggestions welcomed of course though.

    dummydata.xls
    Last edited by plainlazy84; 07-06-2008 at 05:50 PM.

  4. #4
    Forum Contributor
    Join Date
    01-23-2006
    Posts
    194
    Hi
    If it is a one-off exercise you can manipulate the data fairly easily to convert it to one row per product. If it is going to be done regularly maybe you should fix the underlying data format.

    For a one-off exercise..
    use >data >text to columns to split the column with multiple products into multiple columns each with one product. Add headings to these new columns eg Group1, Group2, Group3 etc
    delete all the spare rows above your headings. close the file

    open a new file
    use >data >import external data >new database query.
    select the original excel spreadsheet as the data source.
    select (by clicking on) all the columns except group 2 and group 3 etc.
    click on the SQL button to display the sql and edit it by adding to the end
    "where Group1 is not null
    union all"

    then copy and paste this text twice, delete the last union all, change the references to Group1 to Group2 and Group3 in the pasted text.
    Click on the door icon in the top menu/button bar.

    If you right-click in the data in the answer sheet you can edit the query and see the sql.

    It takes longer to say this than to do it ;-)
    An example is attached which probably will only work if unzipped in C:\ as that is where it was created.

    regards
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1