Calculating number of days if each month has 28 days

Orieus

New Member
Joined
Sep 6, 2021
Messages
2
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Firstly, please forgive my Excel ignorance!

For several years we've been operating on a policy of each month having 30 days, and the year having 360 days. The following forumula was used to work out the number of days between two dates:

=(YEAR(ENDDATE)-YEAR(STARTDATE))*360+(MONTH(ENDDATE)-MONTH(STARTDATE))*30+(IF(DAY(ENDDATE)=31,30,DAY(ENDDATE))-IF(DAY(STARTDATE)=31,30,DAY(STARTDATE)))+1

However, for some reason it has now been changed to each month having just 28 days, and 336 days in a year (ridiculous I know).

I thought it would be easy to just amend, but it tells me that I've entered too many arguments for this function. I guess I need to insert additional parenthesis?

Alternatively, if you're able to suggest an alternative to that very long string, that would also be greatly appreciated, thank you!
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
I have no idea if this is right or not, but based on your description, this is my guess...
Excel Formula:
=(YEAR(ENDDATE)-YEAR(STARTDATE))*336+(MONTH(ENDDATE)-MONTH(STARTDATE))*28+(IF(DAY(ENDDATE)>28,28,DAY(ENDDATE))-IF(DAY(STARTDATE)>28,28,DAY(STARTDATE)))+1
 
Upvote 0
Solution
I have no idea if this is right or not, but based on your description, this is my guess...

Rick, thank you so much for your speedy reply - I believe that this is exactly what I needed! I quickly tested it on a few different date scenarios and it gives the expected result. Thanks again!
 
Upvote 0

Forum statistics

Threads
1,214,416
Messages
6,119,384
Members
448,889
Latest member
TS_711

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