3

Iโ€™m working on an accounting sheet and plotting transactions by emitter.

table showing emitter and value of transactions

When I create a pie chart, two segments with different colors appear despite having the same label. I would like to merge segments with identical label.

pie chart with duplicate labels

1
  • 1
    Thats obvious because the values are different. You need to use Pivot Table with Pivot Charts or use GROUPBY() function or use SUMIF()/SUMIFS() to add the values for the dupes. Commented 16 hours ago

1 Answer 1

3

You should create a summary report first by emitter, then use the following:

enter image description here


=LET(
     _x, GROUPBY(A2:A4, B2:B4, SUM, , 0), 
     HSTACK(CHOOSECOLS(_x, 1), ABS(CHOOSECOLS(_x, 2))))

If you don't have access to GROUPBY() then use the following:

โ€ข For Unique Emitter:

=SORT(UNIQUE(A2:A4))

โ€ข For Expenses:

=ABS(SUMIFS(B2:B4, A2:A4, A7#))

Also, you can use Pivot Table and Pivot Charts. Since you've got negative values like -9.20, -24.69, and -26.55, just make sure that makes sense for a pie chart. They usually work better with positive numbers showing parts of a whole. You could use absolute values or pick a different chart for expenses. A pivot table is usually the quickest and most flexible way to go.


2
  • 1
    I also noticed the fact that negative values would cause troubles for a pie chart, thanks for noticing too and thanks for the answer. Commented 11 hours ago
  • No problem, glad it helped. Yeah, negatives always mess with pie charts. Commented 11 hours ago

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.