+ Reply to Thread
Results 1 to 8 of 8

Date functions

  1. #1
    Registered User
    Join Date
    05-09-2012
    Location
    Bucharest, Romania
    MS-Off Ver
    Excel 2010
    Posts
    3

    Date functions

    Hello! I'm new here and I could use some help with some functions.
    I have a database and want to define a criteria range (to use it in hypothesis testing), and one of them is that the date should be in the last decade of the previous month.
    How do I get this?

    Thanks!

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Date functions

    Hi and welcome to the forum.

    Try

    =DATE(YEAR(A2)-10;MONTH(A2)-1;DAY(A2))

    Change the semi-colons to comma, if you have to do this.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --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.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Forum Expert icestationzbra's Avatar
    Join Date
    01-07-2004
    MS-Off Ver
    2007, 2010
    Posts
    1,421

    Re: Date functions

    =EDATE(A1,-121)

    if the date in cell A1 is May 09, 2012, this formula will give you April 09, 2002. is that what you are looking for? the number 121 corresponds to 12 months in 10 years plus one more month. the minus sign is for back-dating; drop it and you get forward-dating.
    - i.s.z -
    CSE, aka Array aka { }, formulae are confirmed with CONTROL+SHIFT+ENTER.
    Replace commas ( , ) with semicolons ( ; ) in formulae, if your locale setting demands.
    All good ideas are courtesy resources from this forum as well as others around the web.
    - e.o.m -

  4. #4
    Registered User
    Join Date
    05-09-2012
    Location
    Bucharest, Romania
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Date functions

    Sorry if I haven't expressed myself clearly. When I said the last decade of the previous month, I meant the last 10 days (approximately) of the previous month. Since it's May now, the date should be between April 20th and April 30th :D

  5. #5
    Forum Expert icestationzbra's Avatar
    Join Date
    01-07-2004
    MS-Off Ver
    2007, 2010
    Posts
    1,421

    Re: Date functions

    !!! decade means 10 years!!!

    if you can do with the last day of April, then this will work for you:

    =EOMONTH(A1,-1)

    if you want a date that is somewhere between 20th and 30th (excluded), then you can go ahead and deduct 7 days (just an example) from the above:

    =EOMONTH(A1,-1) - 7

    remember to "date" format the cell in which this formula is placed.
    Last edited by icestationzbra; 05-09-2012 at 03:38 AM.

  6. #6
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Date functions

    Now...You confused me. ..

  7. #7
    Registered User
    Join Date
    05-09-2012
    Location
    Bucharest, Romania
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Date functions

    Thanks, I'll try this one.

    And I swear I know decade referrs to years, but the stupid exercise was written this way

  8. #8
    Forum Expert icestationzbra's Avatar
    Join Date
    01-07-2004
    MS-Off Ver
    2007, 2010
    Posts
    1,421

    Re: Date functions

    oh, so getting help doing homework, eh???

    if so, it is unfair to your peers...

+ 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