+ Reply to Thread
Results 1 to 5 of 5

Thread: Calculate a date from a given date

  1. #1
    Registered User
    Join Date
    01-17-2011
    Location
    Kent
    MS-Off Ver
    Excel 2007
    Posts
    34

    Calculate a date from a given date

    Hello every one!

    i need to check a date with another, using the below logic:

    if product = A then Date D = 6 months after Date C
    If Product = B then date D = 1 month after Date C

    Date C is predifined with each file, and is in the following format "yyyymmdd"

    To put this into context, Date C is the date account opened, and Date D is the Next Statement Date. both dates will be present in the file, but i need to check that Date D is correct based off the product type and Date C
    Last edited by AppSupportKarl; 01-06-2012 at 05:59 AM.

  2. #2
    Valued Forum Contributor Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens Greece
    MS-Off Ver
    Excel 2003
    Posts
    2,299

    Re: Calculate a date from a given date

    Hi

    Pls try this:

    =IF(A1="a";DATE(YEAR(C1);MONTH(C1)+6;DAY(C1));IF(A1="b";DATE(YEAR(C1);MONTH(C1)+12;DAY(C1))))

    Hope to helps you.
    Regards

    Fotis.

    I am proud that i am Greek.

    Just to know every one.We Greeks, we are nοt proud of our politicians. Υou?

    Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Please,mark your thread [SOLVED] if you received your answer.


    My Avadar picture, is from Athens Acropolis.
    http://www.theacropolismuseum.gr

    http://www.visitgreece.gr/

  3. #3
    Valued Forum Contributor
    Join Date
    12-28-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    276

    Re: Calculate a date from a given date

    You could just use EDATE to shift Date C by the given number of months. EDATE requires the Analysis Toolpak to be installed in versions earlier than 2007, but I see you are using 2007. EDATE is a worksheet function.

  4. #4
    Registered User
    Join Date
    01-17-2011
    Location
    Kent
    MS-Off Ver
    Excel 2007
    Posts
    34

    Re: Calculate a date from a given date

    Many thanks firefly, this is perfect for what i need!

    Fotis,

    thanks for your suggestion, i was going to try something similar, but for end of month days (e.g. feb 28th) i wasn't sure if it would work or not

  5. #5
    Valued Forum Contributor Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens Greece
    MS-Off Ver
    Excel 2003
    Posts
    2,299

    Re: Calculate a date from a given date

    ..Sometimes Excel2007, is better than 2003.......

    Glad to find your solution.
    Regards

    Fotis.

    I am proud that i am Greek.

    Just to know every one.We Greeks, we are nοt proud of our politicians. Υou?

    Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Please,mark your thread [SOLVED] if you received your answer.


    My Avadar picture, is from Athens Acropolis.
    http://www.theacropolismuseum.gr

    http://www.visitgreece.gr/

+ Reply to Thread

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