# How do I pull the last 8 weeks of a table in excel 2010

I have a table that I manually drop 1 column of data a week into. I need to pull the last  8 weeks of data and graph it. Keep in mind this table has the whole year of data in it. At the top of the columns it has the week ending dates (for example July 3rd) as the titles.
LVL 19
###### Who is Participating?

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Commented:
Do you know how to do this manually?  If so, have you done this?
EngineerCommented:
You can know the last date using the MAX() function
You can find the column number of this last date with the help of the MATCH() function
Subtract 7 from that column number to get the column number of the first of the eight weeks
Use the offset formula to return the desired 8 column data
Finance AnalystCommented:
The other question I asked is for raw data that is pulled from a ticketing system. This table is manually created and what I do is copy one column at a time to the table and manually add the week ending dates to the top of the column.
Finance AnalystCommented:
Alongside your growing data create another dataset with only eight columns.

Column 8 (assuming AF) of that set will be the following formula:

=MAX(\$A\$1:\$AA\$1)

Where AA is the column AFTER your existing last column.

Columns 7 to 1 will be:
=AF1-7

copied left, the reference to AF will reduce.

As you need new columns in your source data, insert a column before entering the data, this will push everything to the right one column but the references will change. You can then use the new table of 8 columns for your graph.

If that doesn't make sense, upload a sample file on which to demonstrate.

Thanks
Rob H
Finance AnalystCommented:
Alternatively, put your 8 column set to the left of the source data or on a separate sheet.

If to the left of the source data, the MAX function can refer to virtually the whole row or 52 columns ie one for each week eg K:BJ (columns A to H for the copy set and a couple of spare columns before the source data starts in K.

If on another sheet, the MAX can refer to the whole row if so required but if you only have 1 years worth of data it can be 52 columns, ie A:AZ

For both of these you don't have to insert columns, you can just paste in the new data on the right hand side of the existing and add the date in row 1.

Thanks
Rob H
Here is a sample file.... I tried what you said but it did not work for me....
samplesheet7615.xlsx
Finance AnalystCommented:
See attached.
samplesheet7615.xlsx

Experts Exchange Solution brought to you by