# Display last 36 months based on current month/ year

Hi,

I have string field where I get current month as:

06.2013

I want to make matrix based on this current month for last 36 months as:

02.2011     03.2011   04.2011  ... ... .. .. ... . . . . 02.2013   03.2013  04.2013  05.2013  06.2013

Please provide a formula to achieve it.

I don't want to use off-set function as not supported by Dashboards.

Thanks.
###### Who is Participating?

Commented:
The attached spreadsheet has working examples of both of my approaches described in http:#a39242064

Q-28155292.xls
0

Commented:
Enter this formula into A1...

=TEXT(DATE(YEAR(NOW()),MONTH(NOW())-36+COLUMN(),1),"mm.yyyy")

Now, copy that across through AJ1
0

Author Commented:
Hi.

Thanks but I don't want to use system time to caculate current month. This month/ year has to be calculated from a cell where month/ year is displatyed as string 06.2013

Hope I get revised formula soon.

Nick
0

Commented:
>>from a cell where month/ year is displatyed [sic] as string 06.2013

Is that the actual value entered in the cell, or just the displayed number format?

If the value is itself entered as a date, then just change my formula for A1 to:

=TEXT(DATE(YEAR(\$A\$5),MONTH(\$A\$5)-36+COLUMN(),1),"mm.yyyy")

Changed \$A\$5 to the real cell holding the value.

If it is actually entered as text...

=TEXT(DATE(YEAR(SUBSTITUTE(\$A\$5,".","/1/")),MONTH(SUBSTITUTE(\$A\$5,".","/1/"))-36+COLUMN(),1),"mm.yyyy")
0

Author Commented:
I have cell A5 holding text value 06.2013

When I used formula:

=TEXT(DATE(YEAR(SUBSTITUTE(\$A\$5,".","/1/")),MONTH(SUBSTITUTE(\$A\$5,".","/1/"))-36+COLUMN(),1),"mm.yyyy")

Excel said error in formula and it highlights SUBSTITUTE. No further error information.

0

Author Commented:
Worked like wonder.

Thanks a lot.
0

Author Commented:
Hi  matthewspatrick.

Just a quick fix otherwise I open new case.

What about if I only have "2013" (current year text without month like above). How I can off-set to 2012, 2011, 2010??

Thanks.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.