Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Im having data like this:

Date      Customer   Amount Month
09-01-12  A          20     =A2 (formatted so it shows month name)
10-01-12  B          10     =A3 (formatted so it shows month name)
18-01-12  B          25     etc
05-02-12  A          15     etc

I want to use a pivot table to see the total amount per month per customer. e.g.

Customer   Jan  Feb  Total
A          20   15   35
B          35        35
Total      55   15   70

I added an extra column to the data, with the month formatted as 'Jan', 'Feb' etc. In the pivot table it gives a column for each date, it does not group by month. So the result is this:

Customer   Jan  Jan  Jan Feb  Total
A          20            15    35
B               10   25        35
Total      20   10   25   15   70

How do I fix this?

share|improve this question
up vote 3 down vote accepted

I think the problem is that the "Month" column has different values for each date. So LibreOffice doesn't understand you want to group the output by distinct months.

Thus, a solution could be to "construct" a date based on cell A2, ignoring the day:

  • Replace the Formula "=A2" in the "Month" column by


    This way, you will have the same date for every month cell, depending on the original date.

  • Then, format that column using the pattern "MMMM" to display the date as "January".

  • Now, refresh the Pivot Table or re-create it with "Month" in "Column Fields", "Customers" in "Row Fields" and "Sum - Amount" in "Data Fields".

This should yield the desired result.

share|improve this answer
Thanks, that was the solution. Too bad LibreOffice can't manage those things by itself. – Lennart Jul 19 '12 at 8:24

I'm not sure whether this was possible in LibreOffice that was current in the time when this question was asked but now this is quite easy to do, so if anyone stumbles upon this question this might help:

Using data from the input table (btw. for this last column "Month" is redundant) one should create Pivot table (select the table and from the menu select Data > Pivot Table > Create...) so that in the Column Fields is the Date field, in Row Fields is the Customer field, and in Data Fields the Amount field. Then when the Pivot table is created select/click on any cell in the row which contains dates and from the menu select Data > Group and Outline > Group and select Group By > Intervals and check Months (or any interval you would like).

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .