Iโm working on an accounting sheet and plotting transactions by emitter.
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.
You should create a summary report first by emitter, then use the following:
=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.
GROUPBY()
function or useSUMIF()
/SUMIFS()
to add the values for the dupes.