0

The Issue

I'm trying to count instances of a number in each column. For a simgle column of data, this works fine, but when I add more columns, the count always reflects the first column.

Attached is a minimal example of the issue I'm facing:

Minimal example showing column A being counted for both column A & B

What I Am Doing

  1. I am selecting the entire data set (which in reality is much bigger) and inserting a pivot table.
  2. I am not ticking the box labelled Add this data to the Data Model in the dialog that pops up.
  3. in the PivotTable Fields pane on the right I am adding my columns of data to the VALUES quadrant and selecting Count of <A/B...>.
  4. In the column quadrant a field named VALUES automatically appears.
  5. I add one of the columns to the ROWS quadrant.
  6. I then go on to group the rows (not shown in this minimal example)

What I Have Tried

  • Adding both column FIELDS to the ROWS quadrant of the PivotTable Fields pane on the right, but this creates a strange nested "Row Lables" column.

  • Adding a seperate column for the values to be counted.

  • Count Of Numbers instead of Count

  • Various tutorials on how to correctly achieve this for a single column, in case I was doing it wrong.

  • Pivot Table won't show correct data relating to the row names appears to do what I want, but I don't seem to have access to PowerQuery.

Update

After looking at How to "unpivot" or "reverse pivot" in Excel? I now have Minimal example showing column A being cut off.

Clearly this is much closer to what I want (and I can turn off the grand totals in the pivot table's settings easily enough) but it is now bizarrely ignoring the first column. (A blank column to the left of the range fixes it, but I have no idea why...)

Troyseph
  • 121

0 Answers0