+ Reply to Thread
Results 1 to 12 of 12

Calculate Date Based On System Time

  1. #1
    Registered User
    Join Date
    08-20-2013
    Location
    Schenectady, NY
    MS-Off Ver
    Excel 2011 Mac
    Posts
    64

    Calculate Date Based On System Time

    Hi. The current formula that I have can only calculate a date that is 5 months ahead of the cell date:

    =DATE(YEAR(A1),MONTH(A1)+5,DAY(A1))

    Is there a way to modify the formula to calculate a date that is 5 months ahead of the computer's system time?

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Calculate Date Based On System Time

    You can use the TODAY() function..

    So in A1, put
    =TODAY()

    Then the formula you just posted now refers to the current date according to the computer.

  3. #3
    Registered User
    Join Date
    08-20-2013
    Location
    Schenectady, NY
    MS-Off Ver
    Excel 2011 Mac
    Posts
    64

    Re: Calculate Date Based On System Time

    Thanks, that worked!

    Is there a way to calculate 5 months ahead of the computer's system time without specifying it?

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Calculate Date Based On System Time

    Depending what you understand by "5 months ahead" [what's 5 months ahead of 30th September 2013?] you might want to use EDATE

    =EDATE(TODAY(),5)
    Audere est facere

  5. #5
    Registered User
    Join Date
    08-20-2013
    Location
    Schenectady, NY
    MS-Off Ver
    Excel 2011 Mac
    Posts
    64

    Re: Calculate Date Based On System Time

    When I used that formula in a random cell, the result was 41721. Is that formula not able to calculate a date?

  6. #6
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Calculate Date Based On System Time

    41721 is how excel stores dates (it's the number of days since 1st Jan 1900) - you need to format the cell in a valid date format

    Right click > format cells > number > date > choose a format like m/d/yyyy

  7. #7
    Registered User
    Join Date
    08-20-2013
    Location
    Schenectady, NY
    MS-Off Ver
    Excel 2011 Mac
    Posts
    64

    Re: Calculate Date Based On System Time

    Thanks. Is there a way to modify that formula to calculate 5 calendar months from today?

    Ex:

    5 months from today (10/23/13) is 3/23/14.

    5 calendar months from today (10/23/13) is 3/1/14.

  8. #8
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Calculate Date Based On System Time

    Quote Originally Posted by jhudson444 View Post
    5 calendar months from today (10/23/13) is 3/1/14.
    You mean to always give 1st of the month? Perhaps try this

    =EOMONTH(TODAY(),4)+1

    That will give you 1st March 2014 today, come 1st November that will change to 1st April.....

  9. #9
    Registered User
    Join Date
    08-20-2013
    Location
    Schenectady, NY
    MS-Off Ver
    Excel 2011 Mac
    Posts
    64

    Re: Calculate Date Based On System Time

    Thanks!

    Is there a way to modify that formula (or create a new one) which will give me the 1st of the month that is 5 months ahead of a range of cells that has less than 2 words?

    Ex.

    .....A..........B
    4/1/13......excel
    6/4/13......excel
    7/2/13............

    The range between 6/4/13 and 7/2/13 has only one word, so 5 months (with the first of the month) ahead of 7/2/13 is 12/1/13. The formula would be based on the criteria of "less than 2 words" in column B.
    Last edited by jhudson444; 10-23-2013 at 06:29 PM.

  10. #10
    Registered User
    Join Date
    08-20-2013
    Location
    Schenectady, NY
    MS-Off Ver
    Excel 2011 Mac
    Posts
    64

    Re: Calculate Date Based On System Time

    The following is what I have so far:

    This formula counts 5 calendar months ahead of 7/2/13:

    =EOMONTH(A3,4)+1

    This formula counts the number of "excel" words:

    =SUMPRODUCT((LEN(B1:B3)-LEN(SUBSTITUTE(B1:B3,"excel","")))/LEN("excel"))

    This formula counts the number of "excel" words in the past 2 calendar months based on today's date:

    =SUMPRODUCT((LEN(B1:B3)-LEN(SUBSTITUTE(B1:B3,"excel","")))*(A1:A3>=EDATE(TODAY()-DAY(TODAY())+1,-2)))/LEN("excel")

    Is it possible to combine these formulas (or similar ones) to calculate a date when there will be less than two "excel" words?
    Last edited by jhudson444; 10-23-2013 at 07:13 PM.

  11. #11
    Registered User
    Join Date
    08-20-2013
    Location
    Schenectady, NY
    MS-Off Ver
    Excel 2011 Mac
    Posts
    64

    Re: Calculate Date Based On System Time

    I can upload a workbook with my current formulas if anyone wants.

  12. #12
    Registered User
    Join Date
    08-20-2013
    Location
    Schenectady, NY
    MS-Off Ver
    Excel 2011 Mac
    Posts
    64

    Re: Calculate Date Based On System Time

    To help clarify for anyone who is currently trying to help me out, the formula logic should be something like:

    "If a range of cells has [criteria 1], then [criteria 2]"

    Criteria 1: Less than 2 words
    Criteria 2: Add 5 months to the most-recent cell which does not meet criteria 1

    Hopefully this helps to clarify the problem.

+ 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] Calculate time remaining based on end date & time and current date
    By Kaz09 in forum Excel Formulas & Functions
    Replies: 33
    Last Post: 08-19-2014, 07:11 AM
  2. Reduce Day Count in Excel based on System Time and Date
    By kittu55 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 02-05-2013, 10:24 AM
  3. Calculate ship date based on date and time order is received
    By joekomar in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-23-2013, 10:57 PM
  4. changing value in cell based on system date and time
    By Saky in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-22-2010, 03:56 AM
  5. Replies: 6
    Last Post: 03-04-2010, 03:04 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