Calculate date Formula

thescream80

Board Regular
Joined
Mar 28, 2014
Messages
119
Office Version
  1. 2019
  2. 2016
Platform
  1. MacOS
I am trying to calculate number of days per month without having to change the date every day and it to only calculate to the days within THAT month.

A1 =TODAY()
A2 =2/1/22

To get today's date updated automatically i am using this formula =TODAY()
To get current day count from the beginning of the month I subtract =A1-A2

Is that a way to Max A1 so it does not count the days past 2/28, or 3/31 ect

=TODAY()Number of Days of Current month
=2/1/22=A1-A2
Need the above to not count the days after the end of the month

Thank you for any help
 
Last edited:

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
It's not clear what results you're after here?

... but: =DAY(EOMONTH(TODAY(),0)) tells you that there are 28 days in this month.
 
Upvote 0
It's not clear what results you're after here?

... but: =DAY(EOMONTH(TODAY(),0)) tells you that there are 28 days in this month.
Hi Stephen!

What I am trying to achieve is to have a formula that I will apply to every month and for it to count the days in that month in real time yet cap the number at the end of the month.
For example using today Feb 16th

January formula = 31
February = 16 (tomorrow 17)

When the date is March 1st though Feb=28 and March =1


Does that make more sense now?
 
Upvote 0
=DAY(A1)
Is it are you looking for?
So I think I ran into an issue

Your solution works for that month. But when the next month happens it will reset the days. I am trying to find a formula that will count the existing month days in real time but when the next month starts it will keep the days already counted.
Example

2022 - 47 (as of feb 16th)
Jan - 31
Feb - 16 (as of feb 16th)
March
April
May
June
July
August
September
October
November
December
 
Last edited:
Upvote 0
I think that might be it. One question is how could i add a modification to also track it for the year?
Not clear for me.
If today is 17-Feb, it returns 17
If today is 31-Jan, it returns 31

Provide more specific sample, with your desired outcome.
 
Upvote 0
Not clear for me.
If today is 17-Feb, it returns 17
If today is 31-Jan, it returns 31

Provide more specific sample, with your desired outcome.
So I think I ran into an issue

Your solution works for that month. But when the next month happens it will reset the days. I am trying to find a formula that will count the existing month days in real time but when the next month starts it will keep the days already counted.

Example each of the following will be in a different cell. - I want to count the days real time while in that month BUT when the month or year is over it counts the max days for that time period that already has passed. see below

2022 - 47 (as of feb 16th)
Jan - 31
Feb - 16 (as of feb 16th)
March - 0
April- 0
May- 0
June- 0
July- 0
August- 0
September- 0
October- 0
November- 0
December- 0
2023- 0
 
Upvote 0
Upvote 0

Forum statistics

Threads
1,215,480
Messages
6,125,054
Members
449,206
Latest member
Healthydogs

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