How do you calculate the number of first days of the month have passed between a set date and today

damian_r_Home

Board Regular
Joined
Jan 8, 2005
Messages
231
Office Version
  1. 365
  2. 2007
Platform
  1. Windows
Morning All.
THis should be simple (I think) but lost as to how to do it.

A1 contains a date, eg 1st April 2023
A2 is =TODAY()
A3 needs to show how many 1st's of a month have passed by between A1 and A2.

What would be really clever is if in cell A4 we could put 1, 2, 3, 4 etc to represent the 1st, 2nd, 3rd, 4th etc of the month and A3 could then return how many of them have passed between A1 and A2

As always, your help is appreciated.

D
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
are you using 365 or 2007 for this question?

for 365:
Mr Excel Questions 75.xlsm
A
14/2/2023
23/19/2024
311
Sheet16
Cell Formulas
RangeFormula
A2A2=TODAY()
A3A3=SUM(--(DAY(SEQUENCE(A2-A1,1,A1,1))=1))
 
Last edited:
Upvote 0
I just realized what I gave above does not include the last day if it s the first of the month, use the green highlighted formula instead:
Mr Excel Questions 75.xlsm
ABCD
14/1/20234/2/20234/1/20234/2/2023
23/19/20243/19/20244/1/20244/1/2024
312111312
Sheet16
Cell Formulas
RangeFormula
A2:B2A2=TODAY()
C2:D2C2=TODAY()+13
A3:B3A3=SUM(--(DAY(SEQUENCE(A2-A1,1,A1,1))=1))
C3:D3C3=SUM(--(DAY(SEQUENCE(C2-C1,1,C1,1))=1))+(DAY(C2)=1)



You can also use the =DATEDIF Function (Also not available in 2007) Although this is for LOTUS 1-2-3 compatibility and is not always reliable for some arguments.

Mr Excel Questions 75.xlsm
ABCD
14/1/20234/2/20234/1/20234/2/2023
23/19/20243/19/20244/1/20244/1/2024
312111312
41312
Sheet16
Cell Formulas
RangeFormula
A2:B2A2=TODAY()
A3:B3A3=SUM(--(DAY(SEQUENCE(A2-A1,1,A1,1))=1))
C2:D2C2=TODAY()+13
C3:D3C3=SUM(--(DAY(SEQUENCE(C2-C1,1,C1,1))=1))+(DAY(C2)=1)
C4:D4C4=DATEDIF(C1,C2,"m")+(DAY(C2)=1)
 
Last edited:
Upvote 0
Hi

Mappe2
ABCD
101.04.2023112
219.03.2024212
3312
4412
5512
6612
7712
Tabelle1
Cell Formulas
RangeFormula
C1:D32C1=LET( d,DAY(SEQUENCE(A2-A1,,A1)), d_m,SEQUENCE(31), f,FREQUENCY(d,d_m), result,HSTACK(d_m,f), result)
A2A2=TODAY()
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

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