+ Reply to Thread
Results 1 to 12 of 12

Creating a changeable value in EDATE formula

  1. #1
    Forum Contributor
    Join Date
    12-22-2006
    Posts
    114

    Creating a changeable value in EDATE formula

    I am trying to have the EDATE formula change based on today's date.

    I am using the following formula:

    =TEXT(AX114,"mm")-TEXT(TODAY(),"mm")

    Where AX114 is a date (01/05/2015). If I break apart the two TEXT formulae, they produce a 5 and a 6. Therefore the result should be -1.

    Is there anyway of re-writing the formula above in order to produce a value of -1?

    Many thanks,

    Alex

  2. #2
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Creating a changeable value in EDATE formula

    will this work for you?

    Please Login or Register  to view this content.
    EDIT: this assume that your date is a real XL date. IE: a number
    Ernest

    Please consider adding a * if I helped

    Nothing drives me crazy - I'm always close enough to walk....

  3. #3
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,944

    Re: Creating a changeable value in EDATE formula

    if the not works attach sample file with expected result
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  4. #4
    Forum Contributor
    Join Date
    12-22-2006
    Posts
    114

    Re: Creating a changeable value in EDATE formula

    Thank you so much! That works perfectly except when it goes into a previous year. i.e. the result when it goes back to:

    February it gives 2-6 = -4
    January it gives 1-6 = -5

    But then December it gives 12-6 = 6

    Rather than -6.

    Can you think of a solution to keep it going back further and further? Maybe I have to include years aswell?

    Many thanks,

    Alex

  5. #5
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,804

    Re: Creating a changeable value in EDATE formula

    Try using this formula

    =DATEDIF(AX114,TODAY(),"m")*-1
    Last edited by daddylonglegs; 06-03-2015 at 12:20 PM.
    Audere est facere

  6. #6
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2504
    Posts
    13,643

    Re: Creating a changeable value in EDATE formula

    Perhaps =mod(MONTH(A1)-MONTH(TODAY(),12)-12 ( works but not elegant)

  7. #7
    Forum Contributor
    Join Date
    12-22-2006
    Posts
    114

    Re: Creating a changeable value in EDATE formula

    neither of those formulae seem to work. The DATEIF formula produces a whole series of hash tags and the second formula says there are too many arguments?

  8. #8
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Creating a changeable value in EDATE formula

    I think there should be a ")" after the TODAY() ....I adjusted it like that and it worked really slick....

    Please Login or Register  to view this content.

  9. #9
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2504
    Posts
    13,643

    Re: Creating a changeable value in EDATE formula

    Thanks judge

  10. #10
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Creating a changeable value in EDATE formula

    my pleasure...

  11. #11
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Creating a changeable value in EDATE formula

    @simmo86 --- so did this fix your issue?...

  12. #12
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,804

    Re: Creating a changeable value in EDATE formula

    Quote Originally Posted by simmo86 View Post
    neither of those formulae seem to work.
    It would be helpful if you were to define exactly what results you expect and what the parameters are.

    Is AX114 always a date in the past?

    How far in the past might it be?

    Is it always 1st of the month or can it be any date?

    Depending on the answers to the above it would then be helpful to give some sample dates with expected results. For example, we know you want -6 if AX114 is a December 2014 date (based on today being in June 2015). Is the result the same for any date in the month, what if the date is December 2013 or December 2000, what result do you expect then?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] EDate Formula Issue?
    By ptmuldoon in forum Excel General
    Replies: 2
    Last Post: 01-23-2015, 12:05 PM
  2. Changeable range
    By jramia in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-12-2011, 05:57 AM
  3. EDATE formula works on one computer, not on another
    By lsutiger in forum Excel General
    Replies: 2
    Last Post: 08-12-2010, 08:32 PM
  4. Changeable indexes
    By Steel_lady in forum Excel General
    Replies: 3
    Last Post: 05-07-2008, 01:15 PM
  5. Edate Formula
    By ROSE2102 in forum Excel General
    Replies: 2
    Last Post: 01-20-2006, 02:50 PM

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