Dynamic Chart Range - last x rows AND previous x rows

arcaidius

Board Regular
Joined
Dec 4, 2018
Messages
97
I have a dynamic Chart that uses the last 12 cells in column using:

Excel Formula:
=OFFSET(Sheetname!$C$2,COUNT(Sheetname!$C:$C),0,-13,1)

This gets the last 12 months of data from column C. works great!

Is there a formula that I can get the previous 12 months? so I can make another chart that compares both years?
 
Last edited by a moderator:

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Answered it myself, By getting the row number from previous formula in another cell, and then in one more cell with another Offset by itself.:
If any of you have the same Question, here is how i did it below:

This formula gets the last 12 rows in a column and updates with new entries: (I have in Cell Q3)
Excel Formula:
=OFFSET(Sheetname!$C$2,COUNT(Sheetname!$C:$C),0,-13,1)

This one gets the beggining row number from that formula (-2 rows) (I had this in cell P40 to test it)
Excel Formula:
=MATCH([COLOR=rgb(226, 80, 65)]Q3[/COLOR],A:A,0)-2

This one gets the previous 12 months data:
Excel Formula:
=OFFSET($A$1,[COLOR=rgb(41, 105, 176)]P40[/COLOR],0,-12,1)
 
Last edited by a moderator:
Upvote 0
Solution

Forum statistics

Threads
1,214,523
Messages
6,120,042
Members
448,940
Latest member
mdusw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top