Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ram Ram is offline
external usenet poster
 
Posts: 138
Default How to substract a date in excel to 2000

I want to get exact date (day/month/year) of a person as to when he will be
21 years of age in excel to 2000

eg. My birthdate is 12/12/1972 - 12/12/1993 = 21 years
the output should be in years as shown in eg.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default How to substract a date in excel to 2000

function years21(birthdate as date) as string
on error goto error_line
dim newdate as date
newdate = dateserial(year(birthdate)+21,month(birthdate),day (birthdate))
years21="My birthdate is " & _
format(birthdate,""dd/mm/yyyy") & " - " & _
format(newdate,""dd/mm/yyyy") & " = 21 years"
exit function
error_line:
years21="Error"
end function
--
Hope this helps
Martin Fishlock
Please do not forget to rate this reply.


"ram" wrote:

I want to get exact date (day/month/year) of a person as to when he will be
21 years of age in excel to 2000

eg. My birthdate is 12/12/1972 - 12/12/1993 = 21 years
the output should be in years as shown in eg.

Reply
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
Excel 2000 and date math rasinc Excel Discussion (Misc queries) 4 July 16th 09 05:01 AM
What date is7 days from given date in Excel 2000 GregNga Excel Discussion (Misc queries) 13 November 19th 08 07:00 PM
need held for auto date calculation for adding years and substract srinivas New Users to Excel 1 October 3rd 08 06:54 PM
How do I substract numbers in range like this: Substract(a1..a10) Paulo New Users to Excel 3 November 17th 05 04:48 AM
how do i substract in microsoft excel? nards Excel Worksheet Functions 2 February 6th 05 11:29 PM


All times are GMT +1. The time now is 11:44 AM.

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

About Us

"It's about Microsoft Excel"