Date calculation

srizki

Well-known Member
Joined
Jan 14, 2003
Messages
1,824
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
I have dates in two columns and I am trying to calculate number of months, that is not a problem, the problem is that when a month starts and finish in the same month DATEDIF gives zero, for example, starting dare 01/01/2009 ending date 01/31/2009.
How can I alter the formula to get one month of fraction of a month if there are less days than a full month.

Thanks
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.

rconverse

Well-known Member
Joined
Nov 29, 2007
Messages
1,187
Add an if statement. =if(datedif=0, (date1-date2)/30, datedif)

it won't be exact. Especially in February, but it's going to be close. I guess it depends how accurate you need it. If you're measuring in months would .13 months really throw a wrench into things if were really .15?

HTH
Roger
 

srizki

Well-known Member
Joined
Jan 14, 2003
Messages
1,824
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Thanks Roger
 

Forum statistics

Threads
1,144,374
Messages
5,723,989
Members
422,529
Latest member
mbilal429

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
Top