+ Reply to Thread
Results 1 to 7 of 7

Combine multiple series into one stacked bar graph

  1. #1
    Forum Contributor
    Join Date
    06-27-2013
    Location
    Nebraska
    MS-Off Ver
    Office 365
    Posts
    115

    Combine multiple series into one stacked bar graph

    Hello,

    I am trying to combine multiple series into 1 stacked bar. The data I have is showing minutes that an operator spends idle, working, and blocked for a given task. I am able to create the initial chart without manipulating the data. How do I need to format my data to get to the desired result? Excel file is attached as well.

    Data set
    dataset.PNG

    Initial Chart
    chart 1.PNG

    Desired Result
    chart 2.PNG
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,819

    Re: Combine multiple series into one stacked bar graph

    I'm not sure I understand the question. What you show in rows 24 and 25 is a suitable arrangement for the chart labeled "desired result".

    As a guess, where the values in row 25 appear to be hand entered, perhaps your question is more about looking for an automated way or tool to go from A2:E6 to something equivalent to A24:M25. If that is the case, I would look into the "unpivot" command https://support.microsoft.com/en-us/...5-f588221c7098 in Power Query/Get and Transform. While it will probably give you vertical columns (rather than horizontal rows), that should be just as good at creating the "desired result" chart.

    Am I guessing right?
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Forum Contributor
    Join Date
    06-27-2013
    Location
    Nebraska
    MS-Off Ver
    Office 365
    Posts
    115

    Re: Combine multiple series into one stacked bar graph

    Your assumptions are correct. The data in A24:M25 was hand entered. In the full dataset I will have at least 50 Items to look at so automating the process is what I am looking for. I have never used the Power Query so I will read up on that and give your suggestion a try.

  4. #4
    Forum Contributor
    Join Date
    06-27-2013
    Location
    Nebraska
    MS-Off Ver
    Office 365
    Posts
    115

    Re: Combine multiple series into one stacked bar graph

    So after using the unpivot command I was able to get the data in a format that mostly works. The problem I am having now is I would like to have all the idle time shown as blue, all working time as orange, and blocked time as gray. The end result I am tryin to achieve is a chart that can be read like a timeline. With my data the person is idle for 119 minutes, then works for 36 minutes, blocked for 0 minutes, then idle for 29 minutes, etc.

    chart 3.PNG
    Attached Files Attached Files

  5. #5
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,819

    Re: Combine multiple series into one stacked bar graph

    While tedious, the only way I know to do this it to format each data series as desired (tedious because it must be done one series at a time).

    My guess, though, is that the question behind the question is how to automate the tedious process. If you don't want to do it manually, you can write a VBA macro that will loop through the data series and format according to the "series name" value, but I usually see that as unnecessary. If you build the chart correctly the first time, then each time you enter/paste/write new data to the source data, the formatting should stay the same, so once you've done it (for the largest data set you ever expect to encounter), you should not have to do it again.

    If my guess is correct, then it is mostly a question of how you would best like to approach this -- do you want to build a solid template that you can reuse over and over with different data, or do you want to recreate the chart with each data set and use VBA (or other macro language) to handle the tedious parts?

  6. #6
    Forum Contributor
    Join Date
    06-27-2013
    Location
    Nebraska
    MS-Off Ver
    Office 365
    Posts
    115

    Re: Combine multiple series into one stacked bar graph

    Since the largest number of entries in the data set is unknown I am leaning more towards using VBA to accomplish this.

  7. #7
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,742

    Re: Combine multiple series into one stacked bar graph

    Quote Originally Posted by erice View Post
    I would like to have all the idle time shown as blue, all working time as orange, and blocked time as gray.
    Like this:

    Capture.JPG

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Happy with my answer * Add Reputation.
    If You are happy with solution, please use Thread tools and mark thread as SOLVED.

+ 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. Adding series to stacked graph - problem
    By JamesR12 in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 03-22-2019, 01:31 PM
  2. [SOLVED] I need a stacked 100% graph with three series
    By heytherejem in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 03-29-2018, 09:40 AM
  3. [SOLVED] 3 stacked series in one Graph
    By mc2468 in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 10-16-2015, 03:52 AM
  4. Combine Line Graph & Stacked Column Graph
    By CGreenie in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 09-07-2015, 12:09 PM
  5. Possible to create stacked bar graph in which series are aligned?
    By sithchick in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 03-09-2015, 03:12 PM
  6. [SOLVED] How to make a Stacked Bar Graph for multiple data series
    By vladrrr in forum Excel Charting & Pivots
    Replies: 9
    Last Post: 08-05-2014, 11:04 AM
  7. [SOLVED] Combine stacked column and line chart w/series lines
    By ancillaries in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 04-07-2006, 06:55 PM

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