Auto fill previous months dates in column range

redspanna

Well-known Member
Joined
Jul 27, 2005
Messages
1,602
Office Version
  1. 365
Platform
  1. Windows
Hi all

Can anyone help with a simple formula or VB that will auto populate cells F2:F32 with the previous months days (dates) in dd-mmm-yy format
As you can see from my example I'm using the formula =EOMONTH(Dashboard!A7,-2)+1 in F2 to get the first date of the previous month then I simply add one day to the next row to get the next etxc
Problem is, as in last month there were only 28 days so the current way will pick up the wrong dates when copied down past row 30

Cell Formulas
RangeFormula
F2F2=EOMONTH(Dashboard!A7,-2)+1
G2:G32G2=VLOOKUP(F2,Data!A2:F1900,6,FALSE)
F3:F32F3=F2+1


Any hekp appreciate
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
in your 365, just the formula in E2 and F2, the cells below are empty
Map1
EFG
1Previous Months
2101-feb-22
3202-feb-22
4303-feb-22
5404-feb-22
6505-feb-22
7606-feb-22
8707-feb-22
9808-feb-22
10909-feb-22
111010-feb-22
121111-feb-22
131212-feb-22
141313-feb-22
151414-feb-22
161515-feb-22
171616-feb-22
181717-feb-22
191818-feb-22
201919-feb-22
212020-feb-22
222121-feb-22
232222-feb-22
242323-feb-22
252424-feb-22
262525-feb-22
272626-feb-22
282727-feb-22
292828-feb-22
30
31
32
33
Blad1
Cell Formulas
RangeFormula
E2:E29E2=SEQUENCE(DAY(EOMONTH(J1,-1)))
F2:F29F2=SEQUENCE(DAY(EOMONTH(J1,-1)),,EOMONTH(J1,-2)+1)
Dynamic array formulas.
 
Upvote 0
Solution
in your 365, just the formula in E2 and F2, the cells below are empty
Map1
EFG
1Previous Months
2101-feb-22
3202-feb-22
4303-feb-22
5404-feb-22
6505-feb-22
7606-feb-22
8707-feb-22
9808-feb-22
10909-feb-22
111010-feb-22
121111-feb-22
131212-feb-22
141313-feb-22
151414-feb-22
161515-feb-22
171616-feb-22
181717-feb-22
191818-feb-22
201919-feb-22
212020-feb-22
222121-feb-22
232222-feb-22
242323-feb-22
252424-feb-22
262525-feb-22
272626-feb-22
282727-feb-22
292828-feb-22
30
31
32
33
Blad1
Cell Formulas
RangeFormula
E2:E29E2=SEQUENCE(DAY(EOMONTH(J1,-1)))
F2:F29F2=SEQUENCE(DAY(EOMONTH(J1,-1)),,EOMONTH(J1,-2)+1)
Dynamic array formulas.
Thank you @BSALV that's great
 
Upvote 0

Forum statistics

Threads
1,214,985
Messages
6,122,606
Members
449,089
Latest member
Motoracer88

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