LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Difference between dates returning full months and remaining days

I'm trying to calculate difference between dates, but with a twist- I need to
return the number of full months between beginning and end dates, then, in
the next cell over, the remaining days. Here's where I am so far
(M=BeginDate, N=EndDate) for Months:
=IF(OR(M13="",N13=""),"",IF((DAY(M13)=1),(YEAR(N13 )-YEAR(M13))*12+MONTH(N13)-MONTH(M13)+1,(YEAR(N13)-YEAR(M13))*12+MONTH(N13)-MONTH(M13)))

Days:
=IF(OR(M13="",DAY(M13)=1),"",IF(N13="","",DAY((EOM ONTH(M13,0))-DAY(M13)+1)))

This is returning properly only if EndDate is the last day of a month. I
need it to work regardless of when the month the EndDate falls. Any
suggestions? Any help is much appreciated!
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Difference between dates as # of months, # of days, # of years Iago Excel Worksheet Functions 2 June 25th 08 04:23 PM
i have two days and i want the difference in days, months, year maja Excel Worksheet Functions 7 April 22nd 06 01:14 AM
difference between two dates in years, months and days. ruby Excel Worksheet Functions 2 April 4th 05 04:51 PM
Difference between two dates in months with decimals effem Excel Worksheet Functions 1 November 8th 04 02:16 PM
Difference between two dates in months with decimals effem Excel Worksheet Functions 3 November 5th 04 05:23 PM


All times are GMT +1. The time now is 03:28 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"