+ Reply to Thread
Results 1 to 6 of 6

Return to previous month based on cell value

  1. #1
    Forum Contributor
    Join Date
    03-11-2009
    Location
    Indonesia
    MS-Off Ver
    Excel 2019
    Posts
    252

    Return to previous month based on cell value

    hi

    I want to make the function to return previous month base on other cell value.
    e.g. if A1= jan , B1= dec .

    There's a formula based on current date ;

    =TEXT(DATE(2004,IF(MONTH(TODAY())-1>0,MONTH(TODAY())-1,12),1),"MMMM")

    I expect every suggestion
    regards
    herukuncahyono
    Last edited by herukuncahyono; 04-29-2010 at 09:55 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Return to previous month based on cell value

    Quote Originally Posted by herukuncahyono View Post
    I expect every suggestion
    What does this mean. There can be hundreds of suggestions... how can you "expect" every suggestion. We are here to help not here to meet your expectations.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525

    Re: Return to previous month based on cell value

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!

  4. #4
    Forum Contributor
    Join Date
    03-11-2009
    Location
    Indonesia
    MS-Off Ver
    Excel 2019
    Posts
    252

    Re: Return to previous month based on cell value

    I get the formula above from google( just copy paste), I tried to worksheet and was used only for current date (today).
    I want to modified but Which parts should be changed.

    thanks
    herukuncahyono
    Attached Files Attached Files

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Return to previous month based on cell value

    Try either:

    =EDATE(A1,-1) needs to have Analysis Toolpak Installed through Tools|Addins menu.

    or

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

    Format cell as custom: MMM

  6. #6
    Forum Contributor
    Join Date
    03-11-2009
    Location
    Indonesia
    MS-Off Ver
    Excel 2019
    Posts
    252

    Re: Return to previous month based on cell value

    hi NBVC,

    The second formula is precise and simple.

    Sorry for using the wrong word and thank you for your help

    regards
    herukuncahyono

+ 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