SOLVED

Stacked column chart creation - data reconfiguration

%3CLINGO-SUB%20id%3D%22lingo-sub-1804878%22%20slang%3D%22en-US%22%3EStacked%20column%20chart%20creation%20-%20data%20reconfiguration%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1804878%22%20slang%3D%22en-US%22%3E%3CP%3EHow%20do%20I%20rearrange%20this%20data%20in%20the%20most%20efficient%20way%20to%20create%20a%20stacked%20column%20chart%20from%20it%3F%26nbsp%3B%20The%20dates%20will%20be%20along%20the%20x-axis.%26nbsp%3B%20The%20phytoplankton%20concentration%20(cells%2FmL)%20will%20be%20on%20the%20y-axis.%26nbsp%3B%20The%20columns%20in%20the%20chart%20will%20show%20the%20different%20concentrations%20of%20each%20phyto%20group%2C%20so%20the%20phyto%20groups%20will%20be%20stacked%20in%20each%20column.%26nbsp%3B%20Multiple%20phytoplankton%20groups%20were%20collected%20on%20each%20date.%26nbsp%3B%20I%20need%20to%20transpose%20the%20group%20names%20as%20column%20headers.%26nbsp%3B%20I%20know%20how%20to%20transpose%2C%20but%20how%20do%20I%20transpose%20the%20group%20names%20while%20keeping%20the%20concentrations%20values%20associated%20with%20them%20and%20with%20the%20correct%20date%3F%26nbsp%3B%20Thanks%20for%20helping.%20%23stackedcolumnchart%20%23tranpose%20%23rearrange%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20did%20try%20making%20a%20Pivot%20Table%20using%20this%20data%2C%20which%20puts%20the%20data%20in%20the%20correct%20configuration%20for%20creating%20a%20stacked%20column%20chart.%26nbsp%3B%20However%2C%20the%20pivot%20table%20groups%20the%20date%20by%20month%2C%20tallying%20the%20data%20for%20each%20month%20in%20one%20row%2C%20and%20I%20don't%20know%20how%20to%20expand%20it%20to%20show%20each%20value%20separately.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1804878%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1811009%22%20slang%3D%22en-US%22%3ERe%3A%20Stacked%20column%20chart%20creation%20-%20data%20reconfiguration%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1811009%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F841048%22%20target%3D%22_blank%22%3E%40AmyEH%3C%2FA%3E%26nbsp%3BPerhaps%20like%20in%20the%20attached%20file%3F%20Not%20sure%20though%20what%20you%20mean%20by%20%22transpose%20group%20names%20as%20column%20headers%22.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1812175%22%20slang%3D%22en-US%22%3ERe%3A%20Stacked%20column%20chart%20creation%20-%20data%20reconfiguration%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1812175%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F841048%22%20target%3D%22_blank%22%3E%40AmyEH%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EExcel%20365%20will%20adjust%20the%20row%20and%20column%20headings%20dynamically.%26nbsp%3B%20Older%20versions%20and%20you%20might%20as%20well%20filter%20and%20copy%20them%20manually.%3C%2FP%3E%3CDIV%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20711px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F228715i7668DD1D0C30B482%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22image.png%22%20alt%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EThe%20Excel%20365%20formulas%20are%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-excel%22%3E%3CCODE%3ERow%20heading%20(Date%20)%0A%3D%20UNIQUE(Data%5BDate%5D)%0AColumn%20heading%20(groups)%0A%3D%20TRANSPOSE(UNIQUE(Data%5BGPNAME%5D))%0ABody%20(concentrations)%0A%3D%20SUMIFS(Data%5BcellsPerML2%5D%2C%20Data%5BDate%5D%2C%20date%2C%20Data%5BGPNAME%5D%2C%20groups)%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
New Contributor

How do I rearrange this data in the most efficient way to create a stacked column chart from it?  The dates will be along the x-axis.  The phytoplankton concentration (cells/mL) will be on the y-axis.  The columns in the chart will show the different concentrations of each phyto group, so the phyto groups will be stacked in each column.  Multiple phytoplankton groups were collected on each date.  I need to transpose the group names as column headers.  I know how to transpose, but how do I transpose the group names while keeping the concentrations values associated with them and with the correct date?  Thanks for helping. #stackedcolumnchart #tranpose #rearrange

 

I did try making a Pivot Table using this data, which puts the data in the correct configuration for creating a stacked column chart.  However, the pivot table groups the date by month, tallying the data for each month in one row, and I don't know how to expand it to show each value separately.

7 Replies
Highlighted
Best Response confirmed by AmyEH (New Contributor)
Solution

@AmyEH Perhaps like in the attached file? Not sure though what you mean by "transpose group names as column headers".

 

Highlighted

@AmyEH 

Excel 365 will adjust the row and column headings dynamically.  Older versions and you might as well filter and copy them manually.

 

image.png

The Excel 365 formulas are

 

Row heading (Date )
= UNIQUE(Data[Date])
Column heading (groups)
= TRANSPOSE(UNIQUE(Data[GPNAME]))
Body (concentrations)
= SUMIFS(Data[cellsPerML2], Data[Date], date, Data[GPNAME], groups)

 

Highlighted

@Riny_van_Eekelen Yes, this is exactly what I mean.  How do I do this?  I am using Excel 2016.

 

I had made a Pivot Table, so it looks like I was on the right track there, as that's what you did.  When I made my table, all the dates were grouped by month.  For each row (each month) the table had summed the number of values and showed that sum for each column (each group name).  How do I tell the table to display each unique date instead of grouping them by month?  If each unique date is displayed, then each value will be displayed too, instead of a sum.  That is the end result needs to look like.  Essentially, how do I make my Pivot Table look like yours so I can create that stacked column chart from it? 

Highlighted

@Riny_van_Eeklen

 

I figured it out.  I discovered how to change the action from counts to a sum of the values.  I also figured out how to ungroup the dates so they show as unique dates instead of grouped by month.  Thanks for showing me it was possible, motivating me to keep working on solutions to these two problems.

 

Appreciate the help!

Highlighted

@Peter Bartholomew I don't think I have access to Excel 365, so this is only so helpful.  Thanks for offering advice!

Highlighted

@AmyEH Had been away from my computer all day, so couldn't respond earlier. Glad you figured it out. 

Highlighted

@AmyEH 

I see your point!  It is possible to replace 

= UNIQUE(Data[Date])

by

= SMALL(
    IF(
      MATCH(Data[Date],Data[Date],0)=ROW(Data[Date])-1,
      Data[Date]
    ), 
  k )

but such a formula is such a dog by comparison that I decided it was time to dump my old Excel licence!  Now virtually every formula I write is a dynamic array formula.  It did mean moving to a subscription license though. 

 

Anyway, I am pleased you got the Pivot Table / Chart to come to order!