Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

winninganthem

macrumors 6502a
Original poster
Jun 10, 2008
790
0
Hey everyone, I'm new to using Numbers and spreadsheet things, so I was wondering if you could help me with making a chart.

I have a spreadsheet with several lines of expense data, where each line item falls into one of many expense categories.

I would like to create a pie chart by expense type (ie, Toiletries, Dining, Cellphone, etc), but Numbers wants to treat each line item as a separate expense, even though many of them share the same name.

[Please see the attached image for my example]

Numbers makes the pie chart but puts every individual expense into a separate slice, so I end up getting multiple pie slices that all say "Dining" and so forth. I really just want one pie slice for Dining, one for Cellphone, etc.

Is there a way to combine pie slices or categories? Or is there a better way to accomplish this?

Thanks very much in advance :)

Edit: I realized just now that someone else in another thread is asking how to do this same task, except in Excel. Since this thread is asking how to do it in Numbers, please keep this thread open.
 

Attachments

  • weird-Numbers-problem.png
    weird-Numbers-problem.png
    47.7 KB · Views: 1,232
Hey guys, I figured it out so I'll just post it here so hopefully anyone that needs help can benefit from my answer :).


What I did was that I made a separate table with two columns. Column A for the category, and column B for the total amount.

In column A I listed out all of the expense categories. In column B, it gets a little trickier.

Let's say that I have a category called 'Groceries' and I want to know how much I spent on groceries. I don't need to know how much I spent on everything else, just groceries. This is where the SUMIF function comes in. The SUMIF function adds all the numbers you give it if they meet a certain condition that you specify :D.

The format is =SUMIF(test-range,"Condition”,Sum-range).

So the function asks you to specify
1.) What range of data to test
2.) What standards you are looking for ("the condition")
3.) and if the standards are met, where are the numbers that you want to add located

So, I wanted my function to look through the expenses of my original table. Then my function would add up every expense that has the category "Groceries".

My final code :D :

=SUMIF(TableName :: Category,"=Groceries”,TableName :: Price)


So the code runs through the categories of my expenses, checks if the name equals Groceries, and if it does, then it adds the corresponding value to the total.

Rinse and repeat for the rest of the categories.

---

With the analysis table finished, I selected the whole thing and hit "Charts > Pie Chart". The pie chart came out with all the individual categories. :D
 

Attachments

  • pie-chart-fixed.png
    pie-chart-fixed.png
    43.3 KB · Views: 1,395
You found what I think is the most practical solution.

In Excel you could create a Pivot table, which would automatically sum the categories, and plot that. But Numbers doesn't do Pivot tables.
 
You found what I think is the most practical solution.

In Excel you could create a Pivot table, which would automatically sum the categories, and plot that. But Numbers doesn't do Pivot tables.
Hm, that sounds like Excel would make my life easier haha..

Shame that Numbers looks so much prettier :p

Thanks for the feedback :)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.