Hi.

I have a sheet with a set "template", which purpose is to display data picked from a pivot by day and by month (month being controlled by a dropdown with month number 1-12, i.e.January-December).

The "original" getpivotdata function (when simply refering the pivot to a cell) is:

=GETPIVOTDATA("Revenue",Pivot!$A$3,"Customer segment",5,"Month #","2","Day #","1")

Instead of the static Month #, I´ve used a cell reference (drop down) to choose the month, making it look like this:

=GETPIVOTDATA("Revenue",Pivot!$A$3,"Customer segment",5,"Month #",$B$5,"Day #","1")

Both the above would give me Revenue for customers in segment 5 for the 1st of February (no brainer there).

The problem is that I would like to have a field in which I display revenue for the same segment, but for the previous month. I was hoping I could do something as follows:

=GETPIVOTDATA("Revenue",Pivot!$A$3,"Customer segment",5,"Month #",($B$5-1),"Day #","1")

This since the cell $B$5 with a drop down with months gives me the month number, and by taking the displayed month (e.g. month 2) minus 1 (as in the above example), I was hoping the getpivotdata function would pick up month number 1, i.e. give me the data for January. But it doesn´t seem to work.

Anybody has ideas of what needs to be done, or what function within the GETPIVOTDATA function I could use to get the desired result?

Many thanks.