+ Reply to Thread
Results 1 to 4 of 4

Pivot chart generated by selection

  1. #1
    Registered User
    Join Date
    11-30-2013
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    58

    Pivot chart generated by selection

    Hi all,
    I would like to produce a pivot chart based on a cell selection. Depending on which product is chosen I would like the main chart to display the data from that product's particular worksheet. How do I go about this? Simple v-lookup's don't seem to apply... somehow loading a query or marco?

    Example data attached.

    Thanks in advance for any help given.

    Matt
    Attached Files Attached Files

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Pivot chart generated by selection

    This isn't a pivot chart it makes use of named dynamic ranges. It looks like you want the top 20 from each product. Fortunately your data is already sorted this way. You can't use a regular pivot table since the data is not contiguous. In fact, it's on multiple pages.

    I kept your helper sheet, but I don't use it. My work is done on the Parameters Sheet. Here I have a list of products and what sheets they are on. Cell E1 is the sheet name based on the selected product. Cell E2 is the "base cell" used by the offset command.

    I use the base cell to get the product list: =OFFSET(INDIRECT(Base_Cell),0,0,20,1) - this reference means start in the based cell (cell A8 on the sheet for the selected product), go down zero rows, go right zero columns and give me a range 20 rows deep and 1 column wide. This gives me the names of the top 20 products. I called this name Product_List.

    The values are given by: =OFFSET(Product_List,0,6) which means look at the Product_List and go 6 columns to the left. I called this name Association.

    Here are two wikis that explain how to create named dynamic ranges and how to use them for dynamic charting.
    http://www.utteraccess.com/wiki/Offs...Dynamic_Ranges
    http://www.utteraccess.com/wiki/Dynamic_Charting

    The big wrinkle in this one is that I had to use INDIRECT for the base cell.
    Attached Files Attached Files
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Registered User
    Join Date
    11-30-2013
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    58

    Re: Pivot chart generated by selection

    Thanks! This is great and very clever to me! I haven't used this method before. I can't see the formula's for the OFFSET etc but I presume that's because I don't understand dynamic charting yet.. I will read through the links you sent.

    Much appreciated, thank you!

  4. #4
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Pivot chart generated by selection

    If you go to the the Formulas Ribbon and select Name Manager, you will see the named ranges and their definitions. If you select a name and go down to the Refers To box and click in it, you will see what that range currently points to.

    Also, if you go to a blank sheet (or a blank part of a sheet) and press the F3 key, you will get a list of names. There is a button to press on the dialog box that shows the names and this will copy / paste the names and their definitions into whatever cell is active.

    The wikis will give you more information on named ranges. They are kind of handy because they can be dynamic so formulas, lookups or whatever that reference them won't have to change when data gets added to or taken away from the range. Also sometimes you can assign a static range of cells to a named range. This makes it easier to understand formulas. For example: VLOOKUP(A2,Region_List,2,False) is a lot easier to debug than something like VLOOKUP(A2,'Lookup Sheet'!$A2:$C$28,False).

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 0
    Last Post: 10-02-2017, 02:36 AM
  2. [SOLVED] Update Pivot Table/Chart based on selection for a list box
    By cinstanl in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 06-23-2016, 11:58 AM
  3. Erratic Chart Generated from Data
    By Pete291 in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 07-01-2014, 06:42 PM
  4. Using pivot items from multiple pivot fields within email body generated from VBA
    By GregUnsworth in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-01-2013, 11:10 AM
  5. Pivot Pie Chart - Drop Down Selection Help
    By steverokh in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 10-11-2012, 12:31 AM
  6. Display Filter selection in pivot chart title
    By Aggie81 in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 11-03-2011, 05:42 PM
  7. How to delete the regression generated chart in vba?
    By diablo2man in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-08-2010, 06:50 AM

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