Comparing Google Analytics Date Ranges

I am in the process of creating a spreadsheet to compare Google Analytics data. I am having trouble figuring out how to compare the last 30 days of activity to the previous 30 days.

In Google Analytics there is an option to select "compare to previous activity" which would allow me to view the past 30 days of activity compared to the previous 30 day time period.

How do I go about creating a formula to compare the last 30 days of activity to the previous 30-day time period?

I think this is more suited for Excel rather than solving directly in the GA connector.

Include the ga:date dimension, extract the data to get metadata per day. Have you worked with pivot tables before? Perhaps easiest way to company date intervals. Includes automatic grouping of dates into months etc.