Return value based on previous month

johnswaine

New Member
Joined
Oct 25, 2018
Messages
3
Hi,
I have a table that is a1:a13 Jan - Dec, then below each month are values, I want to add a column for each row to show the value for the previous month from today, so if its October today then return each value for September, then I can create a chart based on the previous month when viewing.

Thanks in advance

JanFebMarAprMayJunJulAugSepOctNovDecPrevious Month
111111111011110
111111111011110
111111111011110

<tbody>
</tbody>

450 450 450 450 450 -

<colgroup><col><col span="11"><col></colgroup><tbody>
</tbody>
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Am assuming that the headers are Text and not dates formatted as Text.

The below should work, but not for jan :)


Book1
ABCDEFGHIJKLM
1JanFebMarAprMayJunJulAugSepOctNovDecPrevious Month
2111111111011110
3111111111011110
4111111111011110
Sheet11
Cell Formulas
RangeFormula
M2=INDEX($A2:$L2,MATCH(TEXT(TODAY(),"mmm"),$A$1:$L$1,0)-1)
 
Upvote 0
try


Book1
ABCDEFGHIJKLM
1JanFebMarAprMayJunJulAugSepOctNovDecPrevious Month
2111111111011110
3111111111011110
4111111111011110
Sheet2
Cell Formulas
RangeFormula
M2=SUMPRODUCT((--(MONTH("1/"&$A$1:$L$1)=MONTH(TODAY())-1))*$A2:$L2)
 
Upvote 0
Am assuming that the headers are Text and not dates formatted as Text.

The below should work, but not for jan :)

ABCDEFGHIJKLM
1JanFebMarAprMayJunJulAugSepOctNovDecPrevious Month
2111111111011110
3111111111011110
4111111111011110

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet11

Worksheet Formulas
CellFormula
M2=INDEX($A2:$L2,MATCH(TEXT(TODAY(),"mmm"),$A$1:$L$1,0)-1)

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>

Brilliant Thanks
 
Upvote 0
Hi

also how can I return last months date in mmm format using "today" so it will automaticall show last month when I open the sheet?
 
Upvote 0
Hi

also how can I return last months date in mmm format using "today" so it will automaticall show last month when I open the sheet?
You can use

=TEXT(EOMONTH(TODAY(),-1),"mmm")
 
Upvote 0

Forum statistics

Threads
1,215,372
Messages
6,124,531
Members
449,169
Latest member
mm424

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