+ Reply to Thread
Results 1 to 5 of 5

date functions

  1. #1
    Registered User
    Join Date
    06-18-2013
    Location
    Oxford, Michigan
    MS-Off Ver
    Excel 2010
    Posts
    10

    date functions

    Somehow, this function produced the date previous to the original date. The only thing I understand is that "dddd" changes the date to a week day. =IF(TEXT(TODAY-1,"dddd")="Sunday",TODAY-3,TODAY-1)

    They used the same function but with plus signs and changed the sunday to saturday to get tomorrows date and weekday. Whenever I change the orignal date ie. (tuesday 4/16/2013) I get feedback that says (monday 4/15/2013 and wednesday 4/17/2013)
    So I always get the day before and the day after. Could someone please explain the mechanics to me?
    Last edited by kilomanjaro4; 06-18-2013 at 09:38 AM.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,734

    Re: date functions

    Really , it should be TODAY() with brackets.

    The first part of the formula is seeing if yesterday (i.e. TODAY()-1, one day before today) was a Sunday. If it was, then the formula will return the date 3 days before today (which will be the previous Friday), but if not it will return yesterday's date.

    If you add numbers onto TODAY() then you will return dates that are in the future (i.e. TODAY()+1 will give you tomorrow's date).

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    06-18-2013
    Location
    Oxford, Michigan
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: date functions

    This is good. Ive been looking over more date stuff and I want to know what parenthesis are for and why would you use them like that? Through this whole spreadsheet they are used that way. Here is another example which I think I now understand.
    =IF(WEEKDAY(TODAY,2)=2,TODAY-1,IF(WEEKDAY(TODAY,2)=3,TODAY-2,IF(WEEKDAY(TODAY,2)=4,TODAY-3,IF(WEEKDAY(TODAY,2)=5,TODAY-4,IF(WEEKDAY(TODAY,2)=6,TODAY-5,IF(WEEKDAY(TODAY,2)=7,TODAY-6,TODAY))))))

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,734

    Re: date functions

    A function ALWAYS has a pair of brackets associated with the name. In some functions (most, in fact) you can pass parameters within those brackets, like SUM(1,2,3,4,5), AVERAGE(A2:A10), LEFT(C3,5) etc., which tell the functions which numbers or ranges or text values you want it to work on.

    However, for a few functions like TODAY() and NOW() there is no need to pass parameters into them, but nevertheless you must still use the brackets for consistency.

    Hope this helps.

    Pete

  5. #5
    Registered User
    Join Date
    06-18-2013
    Location
    Oxford, Michigan
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: date functions

    Thankyou This clears a lot of things up.

+ 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