# Using index to return data from list for last 12 months or months available

1. ## Using index to return data from list for last 12 months or months available

Hi, I have several columns of data. The first column in the list is a column of dates. Basically, what i want to do is return the last 12 months of dates and associated data. Now, keep in mind that the column of dates may not contain 12 months of data so you just return all months shown and associated data.

I have enclosed a file to help show what i want because trying to describe it via words is kinda hard.

2. ## Re: Using index to return data from list for last 12 months or months available

for got to attach the file........

3. ## Re: Using index to return data from list for last 12 months or months available

One way could be this.

In R2 and copy down(you can hide this column).

=COUNTIF(\$O\$2:O2,O2)

Then in U2 and copy down, use this ARRAY formula.

=IFERROR(INDEX(\$O\$2:\$O\$13,SMALL(IF(\$R\$2:\$R\$13=1,ROW(\$O\$2:\$O\$13)-1),ROW(O1))),"")

4. ## Re: Using index to return data from list for last 12 months or months available

thanks.......but is there a way to do it with a single formula that is NOT an array formula?

5. ## Re: Using index to return data from list for last 12 months or months available

ok...this is what i finally came up with........see enclosed file.........seems to work. Soln is in cols y through AJ.

not sure its the best one but it does seem to work.

6. ## Re: Using index to return data from list for last 12 months or months available

Originally Posted by welchs101
not sure its the best one but it does seem to work.
No one is never sure that his own is the best one!

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1