+ Reply to Thread
Results 1 to 7 of 7

Thread: Use a function

  1. #1
    Registered User
    Join Date
    02-02-2010
    Location
    Raiganj, West Bengsl,India
    MS-Off Ver
    Excel 2003
    Posts
    2

    Use a function

    In cell C3 to C78 I am writting date as "DD-MM-YYYY". I am writting 30-Apr-2009. I want a result at G3 just one year after the date I entered at cell C3. So, my result at G3 would be 30 Apr-2010. How can I get it? Please help me.

  2. #2
    Forum Moderator shg's Avatar
    Join Date
    06-21-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2007
    Posts
    25,133

    Re: Use a function

    =date(year(c3)+1,month(c3),day(c3))
    Microsoft MVP - Excel
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Guru JBeaucaire's Avatar
    Join Date
    03-21-2008
    Location
    Bakersfield, CA
    MS-Off Ver
    2010
    Posts
    18,225

    Re: Use a function

    If C3 is recognized by Excel as an actual date value, then put this in G3:

    =DATE(YEAR(C3)+1,MONTH(C3),DAY(C3))
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    “None of us is as good as all of us” - Ray Kroc
    “Actually, I *am* a rocket scientist.” - JB (little ones count!)

  4. #4
    Forum Guru zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    Excel 2007
    Posts
    5,740

    Re: Use a function

    Try this:

    =C3+DATE(1,1,-1)
    "Relax. What is mind? No matter. What is matter? Never mind!"

  5. #5
    Forum Moderator Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2007
    Posts
    5,212

    Re: Use a function

    Hi Chandan, welcome to the forum. In the future, please use a thread title more descriptive of your problem, like "how to add dates".

    For this problem, try using:

    =DATE(YEAR(C3)+1,MONTH(C3),DAY(C3))

    Thanks!

  6. #6
    Forum Moderator shg's Avatar
    Join Date
    06-21-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2007
    Posts
    25,133

    Re: Use a function

    =C3+DATE(1,1,-1)
    That formula has a leap year problem, zbor.
    Microsoft MVP - Excel
    Entia non sunt multiplicanda sine necessitate

  7. #7
    Forum Guru zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    Excel 2007
    Posts
    5,740

    Re: Use a function

    Quote Originally Posted by shg View Post
    That formula has a leap year problem, zbor.
    You are right. When I test it I checked for 29.2.2008 but I didn't check it for 28.2.2008
    "Relax. What is mind? No matter. What is matter? Never mind!"

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0