+ Reply to Thread
Results 1 to 5 of 5

I need to create a distribution plot that sums values

  1. #1
    Registered User
    Join Date
    05-10-2013
    Location
    Vancouver, BC
    MS-Off Ver
    Excel 2010
    Posts
    2

    I need to create a distribution plot that sums values

    Hello,

    I have a large data set that includes, among other things, location and monetary amount for each entry. For example:

    BC 10000
    AB 5000
    BC 13000
    ON 10000
    AB 5000
    AB 30000
    BC 20000

    How do I make a graph or other visual aid that sums up monetary amounts for each location? For this small data a bar graph would have 3 pieces of independant data: AB, BC and ON (bins?) and corresponding monetary totals 40000, 43000, 10000 (sum of what's in each bin?).

    Any help would be greatly appreciated!

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: I need to create a distribution plot that sums values

    Hi and welcome to the forum

    You could probably do this with a pivot chart, but if you are not falimiar with those, try this.

    1st create a table with unique locations
    assuming your locations are in column A, enter this array formula where you want to create the table...
    =IFERROR(INDEX(Sheet1!$A$2:$A$100,MATCH(0,IF(ISBLANK(Sheet1!$A$2:$A$100),"",COUNTIF($A$1:A1,$A$2:$A$100)),0)),"")
    ...confirmed by pressing CTRL-SHIFT-ENTER to activate the array. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL-SHIFT-ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.

    Then use this, copied down to sum the values, assuming your values are in B, and you started the table in D2...
    =sumif(D2:D4,D2,B2:B10)

    adjust ranges as needed.
    You can then create your chart based on that table
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    05-10-2013
    Location
    Vancouver, BC
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: I need to create a distribution plot that sums values

    Thanks for the reply!

    Maybe I'm just not understanding your code but that doesn't seem to be doing what I want. My table has 650 entries with locations from A2:A651 and monetary amounts from B2:B651. I changed the array formula to:

    =IFERROR(INDEX(Sheet1!$A$2:$A$651,MATCH(0,IF(ISBLANK(Sheet1!$A$2:$A$651),"",COUNTIF($A$1:A1,$A$2:$A$651)),0)),"")

    and then tried to implement it from D2:D651. Every cell was just filled with BC, one of the locations. Not really sure if I am implementing it wrong or if there is some misunderstanding.

    Any further help would be much appreciated!

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: I need to create a distribution plot that sums values

    OK lets try it this way instead...

    I put your data from post #1 in A2:B8. Then in D2, copied down 5-6 rows...
    =IFERROR(INDEX($A$2:$A$8,MATCH(0,INDEX(COUNTIF($D$1:D1,$A$2:$A$8),0,0),0)),"")
    and in E2, copied down...
    =IF(D2="","",SUMIF($A$2:$A$8,D2,$B$2:$B$8))

  5. #5
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: I need to create a distribution plot that sums values

    with an pivot table and a pivot graph.

    see the attached file.
    Attached Files Attached Files
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

+ 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