Rounding the months and days in between 2 dates

mart_mrexcel

Board Regular
Joined
Aug 23, 2008
Messages
214
I'm calculating number of months and days in between 2 dates (jan1 2019 & Dec 31, 2019) using a formula Value(Datedif(A1,B1,"M")&"."&datedif(a1,b1,"md")+1) and i am getting a result of 11.31 but i wanted to appear as 12 instead (since 31 completes the whole month).

I want to get the real Number of months and day. example in between Jan 28 2019 to Dec 31 2019, id like to have a result o 11.04 days
 
Last edited:

Tetra201

MrExcel MVP
Joined
Oct 14, 2016
Messages
3,471
Maybe

=VALUE(DATEDIF(A2,B2+1,"M")&"."&TEXT(DATEDIF(A2,B2+1,"md"),"00"))
 

Forum statistics

Threads
1,081,556
Messages
5,359,549
Members
400,533
Latest member
fpenning

Some videos you may like

This Week's Hot Topics

  • VBA (Userform)
    Hi All, I just would like to know why my code isn't working. Here is my VBA code: [CODE=vba]Private Sub OKButton_Click() Dim i As Integer...
  • List box that changes fill color
    Hello, I have gone through so many pages trying to figure this out. I have a 2020 calendar that depending on the day needs to have a certain...
  • Remove duplicates and retain one. Cross-linked cases
    Hi all I ran out of google keywords to use and still couldn't find a reference how to achieve the results of a single count. It would be great if...
  • VBA Copy and Paste With Duplicates
    Hello All, I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is...
  • Macro
    is it possible for a macro to run if the active cell value is different to the value above it
  • IF DATE and TIME
    I currently use this to check if date has passed but i also need to set a time on it too. Is it possible? [CODE=vba]=IF(B:B>TODAY(),"Not...
Top