473,396 Members | 1,724 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Difference between two date

Hi,

I have a big problem with Date function in Excel.
I need to find out the difference between two date.
Suppose, one baby was born in 10th Feb 2000.
What will be his age now (Yr- Month-Day).

Please help.
Jul 7 '07 #1
8 2684
pbmods
5,821 Expert 4TB
Heya, Tapan.

I'm going to go ahead and move this thread to the Windows forum, where one of our resident Experts will be more likely to see it.
Jul 7 '07 #2
bartonc
6,596 Expert 4TB
Heya, Tapan.

I'm going to go ahead and move this thread to the Windows forum, where one of our resident Experts will be more likely to see it.
Sorry, pbmods. The Windows Forum is in the Sys/Admin Group. Excel questions have been relegated to the Misc. Q.s Area. I'm moving it back there.
Jul 7 '07 #3
pbmods
5,821 Expert 4TB
Sorry, pbmods. The Windows Forum is in the Sys/Admin Group. Excel questions have been relegated to the Misc. Q.s Area. I'm moving it back there.
Very well then. We'll keep Office-related q's in Misc.

Tapan, take a look at the date and time functions in Excel.
Jul 8 '07 #4
Hi,

I have gone through all Date Functions available in Excel.
But I did not get my answer.
The Year Function shows no. of Years in between two dates.
The Month Function shows no. of Months in between two dates.
The Day Function shows no. of Days in between two dates.
But I unable to get the Difference between two Dates expressed in Yr.-Month- Date.
Example:

Date 1=10th Feb 2000
Date 2=9th July 2007

Difference = 7 yrs. 4 Months 29 Days

I did not find any formula to solve this problem.
Jul 9 '07 #5
pbmods
5,821 Expert 4TB
Heya, Tapan.

=YEAR(A2)-YEAR(A1)-IF(OR(MONTH(A2)<MONTH(A1),AND(MONTH(A2)=MONTH(A1),
DAY(A2)<DAY(A1))),1,0)&" years, "&MONTH(A2)-MONTH(A1)+IF(AND(MONTH(A2)
<=MONTH(A1),DAY(A2)<DAY(A1)),11,IF(AND(MONTH(A2)<M ONTH(A1),DAY(A2)
>=DAY(A1)),12,IF(AND(MONTH(A2)>MONTH(A1),DAY(A2)<D AY(A1)),-1)))&" months,
"&A2-DATE(YEAR(A2),MONTH(A2)-IF(DAY(A2)<DAY(A1),1,0),DAY(A1))&" days"
This is mostly what you need. Play around with it until you get the result you're looking for.
Jul 9 '07 #6
Try =((YEAR(A2-A1) - 1900) & " Years, " & (MONTH(A2-A1)) & " months, " & (DAY(A2-A1)) & " days")

Where A1 is the first date and A2 is the second date
Jul 9 '07 #7
Hi,
conorb66
Your answer is showing 1 months extra.
and the answer which is taken from MSDN quite ok but
this formula is showing certain discripency when there will be
a leap year.
Otherwise everything is fine.

Very very thanks for your co-operation.
Jul 12 '07 #8
Hi,

I have a big problem with Date function in Excel.
I need to find out the difference between two date.
Suppose, one baby was born in 10th Feb 2000.
What will be his age now (Yr- Month-Day).

Please help.
Simply type date of birth and then subtract it on the current system date. format cell address to date.
Jul 12 '07 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

26
by: Frank | last post by:
For my website i would like to display the age of my son in years, months, days and hours. For now i manage to get a result for totals. Like the total number of days. This is the beginning: ...
4
by: jamesyreid | last post by:
Hi, I'm really sorry to post this as I know it must have been asked countless times before, but I can't find an answer anywhere. Does anyone have a snippet of JavaScript code I could borrow...
3
by: bbawa1 | last post by:
Hi, I have a table which has a field ItemsReceived of type datetime. I have a grid view which has two columns. In first column i have to show the data from field ItemsReceived and in second...
5
by: Julius | last post by:
Hej dudes, I need to calc the difference between two timestamps / dates ... For example what i need to calculate: Date 1: 2007.11.06 - 20:13:04 Date 2: 2007.11.07 - 21:13:04 Difference:...
15
by: student4lifer | last post by:
Hello, I have 2 time fields dynamically generated in format "m/d/y H:m". Could someone show me a good function to calculate the time interval difference in minutes? I played with strtotime() but...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.