redspanna
Well-known Member
- Joined
- Jul 27, 2005
- Messages
- 1,602
- Office Version
- 365
- Platform
- 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
Any hekp appreciate
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
NDA.v13.xlsm | |||||
---|---|---|---|---|---|
E | F | G | |||
1 | Previous Months | ||||
2 | 1 | 01-Feb-22 | 70 | ||
3 | 2 | 02-Feb-22 | 0 | ||
4 | 3 | 03-Feb-22 | 545 | ||
5 | 4 | 04-Feb-22 | 4695 | ||
6 | 5 | 05-Feb-22 | 0 | ||
7 | 6 | 06-Feb-22 | 140 | ||
8 | 7 | 07-Feb-22 | 70 | ||
9 | 8 | 08-Feb-22 | 0 | ||
10 | 9 | 09-Feb-22 | 950 | ||
11 | 10 | 10-Feb-22 | 70 | ||
12 | 11 | 11-Feb-22 | 820 | ||
13 | 12 | 12-Feb-22 | 0 | ||
14 | 13 | 13-Feb-22 | 0 | ||
15 | 14 | 14-Feb-22 | 0 | ||
16 | 15 | 15-Feb-22 | 6470 | ||
17 | 16 | 16-Feb-22 | 1450 | ||
18 | 17 | 17-Feb-22 | 2950 | ||
19 | 18 | 18-Feb-22 | 0 | ||
20 | 19 | 19-Feb-22 | 0 | ||
21 | 20 | 20-Feb-22 | 0 | ||
22 | 21 | 21-Feb-22 | 0 | ||
23 | 22 | 22-Feb-22 | 70 | ||
24 | 23 | 23-Feb-22 | 95 | ||
25 | 24 | 24-Feb-22 | 0 | ||
26 | 25 | 25-Feb-22 | 250 | ||
27 | 26 | 26-Feb-22 | 0 | ||
28 | 27 | 27-Feb-22 | 0 | ||
29 | 28 | 28-Feb-22 | 1090 | ||
30 | 29 | 01-Mar-22 | #N/A | ||
31 | 30 | 02-Mar-22 | #N/A | ||
32 | 31 | 03-Mar-22 | #N/A | ||
33 | |||||
Workings |
Cell Formulas | ||
---|---|---|
Range | Formula | |
F2 | F2 | =EOMONTH(Dashboard!A7,-2)+1 |
G2:G32 | G2 | =VLOOKUP(F2,Data!A2:F1900,6,FALSE) |
F3:F32 | F3 | =F2+1 |
Any hekp appreciate