+ Reply to Thread
Results 1 to 7 of 7

Show Previous Months From Date Using Worksheet Formula?

  1. #1
    Registered User
    Join Date
    02-07-2006
    Posts
    28

    Show Previous Months From Date Using Worksheet Formula?

    hi all,

    quick and easy one - if i wanted to show only previous month results. how would i do it.

    if i had a cell that had a date in it (not today() but actual date 1/2/07) how would i have it so its cell minus one month?

    Thanks

    Joel

  2. #2
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    If you have 01/02/2007 in A1, then

    =DATE(YEAR(A1),MONTH(A1)-1,DAY(A1)) will be 1 month before
    oldchippy
    -------------


    Blessed are those who can give without remembering and take without forgetting

    If you are happy with the help you have received, please click the <--- STAR icon on the left - Thanks.

    Click here >>> Top Excel links for beginners to Experts

    Forum Rules >>>Please don't forget to read these

  3. #3
    Registered User
    Join Date
    02-07-2006
    Posts
    28

    thanks but i forgot something

    thanks old chippy.



    joel

  4. #4
    Registered User
    Join Date
    02-07-2006
    Posts
    28

    thanks but i forgot something

    thanks old chippy.

    the only prob with that is what is its the first month of the year would it still work?

    Cheers

    joel
    Last edited by dj_siek; 03-01-2007 at 09:02 PM.

  5. #5
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Quote Originally Posted by dj_siek
    thanks old chippy.

    the only prob with that is what is its the first month of the year would it still work?

    Cheers

    joel
    Yes, it would just go to the previous month i.e. December the previous year. If you didn't want to show a date if it was the previous year, then

    =IF(MONTH(A1)=1,"",DATE(YEAR(A1),MONTH(A1)-1,DAY(A1))) which say's if the month in A1 is 1 (January), display blank, otherwise show date one month previous.

  6. #6
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    Quote Originally Posted by dj_siek
    hi all,

    quick and easy one - if i wanted to show only previous month results. how would i do it.

    if i had a cell that had a date in it (not today() but actual date 1/2/07) how would i have it so its cell minus one month?

    Thanks

    Joel
    What might the date be, could it be any day in the month? If you have 31st March 2007 in A1 what result would you want?

    If you use the formula

    =DATE(YEAR(A1),MONTH(A1)-1,DAY(A1))

    this will give 3rd March 2007. If you want to get 28th Feb 2007 then perhaps try using EDATE from Analysis ToolPak,

    =EDATE(A1,-1)

  7. #7
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    You're right DDL, forgot about those short months - again!

+ 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