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:
Does #4 work? If not, what results should be?
#4 Does work

Only thing trying ot figure out is how to use this to use this to work with a Year as well

2022 - 47 (as of feb 16th)
2023 - 0
2024 - 0

Any help on that?
 
Upvote 0

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Here's one way you could do it (there are probably several others)

Cell Formulas
RangeFormula
B2:M2B2=EDATE(DATE(YEAR(TODAY()),1,1),COLUMNS($B2:B2)-1)
B3:M3B3=MAX(0,1+MIN(TODAY(),EOMONTH(B2,0))-B2)
#4 Does work
Only thing trying ot figure out is how to use this to use this to work with a Year as well
2022 - 47 (as of feb 16th)
2023 - 0
2024 - 0
Any help on that?
 
Upvote 0
With to day is 17-Feb
A1 could be: 2022 (if <20000 (equals 3-Oct-1954, to define it's year number)) , or real date
B1:
Code:
=IF(A1<20000,TODAY()-DATE(A1,1,1)+1,DAY(MIN(EOMONTH(A1,0),TODAY())))
 
Upvote 0

Forum statistics

Threads
1,214,834
Messages
6,121,871
Members
449,055
Latest member
excelhelp12345

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