+ Reply to Thread
Results 1 to 4 of 4

Getting odd /even years and do some calculations

  1. #1
    Registered User
    Join Date
    07-02-2009
    Location
    Colombo
    MS-Off Ver
    Excel 2007
    Posts
    5

    Unhappy Getting odd /even years and do some calculations

    This is urgent
    I need an Excel formula which will take the month/day from one column plus the year from another column and combine these to make a date in a third column. Then the formula will need to check if the new date in the third column is an odd year. If yes, then if the odd year date is less than the current date, change the date to the nearest odd year which has not occurred yet. Also, the formula will need to do the same thing for dates in an even year.

    I created a formula which combines the month/day into a new date in the third column but am missing the logic for the comparison of odd/even years.

    I need the month/day from column B and the year from column F. The new combined date should appear in column I. I wrote a formula which does some of the work in column I but it's incomplete.

    =MONTH(B169)&"/"&DAY(B169)&"/"&IF(MOD(YEAR(F169),2)=0,IF(YEAR(F169)<TODAY(),(YEAR(TODAY())-YEAR(F169))+YEAR(F169)+1,),IF(YEAR(F169)<TODAY(),(YEAR(TODAY())-YEAR(F169))+YEAR(F169)+2,))
    Last edited by sameeracma; 07-02-2009 at 01:48 PM. Reason: Thread is irrelavent

  2. #2
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208

    Re: Getting odd /even years and do some calculations

    First, saying "This is urgent" will not get you any faster response.

    Here is what I came up with:

    Put in cell I169:
    =DATE(IF(DATE(YEAR(F169),MONTH(B169),DAY(B169))<TODAY(), IF(MOD(YEAR(TODAY())-YEAR(F169),2)=0,YEAR(TODAY())+2,YEAR(TODAY())+1), YEAR(F169)),MONTH(B169),DAY(B169))

    I also see that you had a couple formulas that could be shortened quite a bit.

    Cell C169:
    =IF(LEN(TRIM(B169))=0,"", TEXT(B169,"m")&"-"&TEXT(B169,"mmmm"))

    Cell G169:
    =IF(LEN(TRIM(F169))=0,"", TEXT(F169,"m")&"-"&TEXT(F169,"mmmm"))

    Cell J169:
    =IF(LEN(TRIM(I169))=0,"", TEXT(I169,"m")&"-"&TEXT(I169,"mmmm"))

    HTH

    Jason

  3. #3
    Registered User
    Join Date
    07-02-2009
    Location
    Colombo
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Getting odd /even years and do some calculations

    Its still giving me errors. did you try that formula in that attached excel?. i'm getting some errors. pls fix this.

  4. #4
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208

    Re: Getting odd /even years and do some calculations

    Yes I did. See attached.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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.6.0 RC 1