+ Reply to Thread
Results 1 to 6 of 6

If, then, else question.

  1. #1
    MAB
    Guest

    If, then, else question.

    This is my dilema... I need to display a status of 1 month previous and 2
    months previous.

    My problem arises in January and February. What I need in the statement for
    current month - 1 is: If month(today()) = 1, then 12, else month(today())-1.
    What I need for the statement current month -2 is: If(month(today()) = 1,
    then 11, If month(today())= 2, then 12, else month(today())-2. I'm just not
    certain how to write this in Excel.

    Thank you.


  2. #2
    bpeltzer
    Guest

    RE: If, then, else question.

    =if(month(today())<3,month(today())+10,month(today())-2) is one way.
    If you want to use nested ifs:
    =if(month(today())=1,11,if(month(today())=2,12,month(today())-2)))
    In general:
    =if(condition_1,cond_1_value,if(condition_2,cond_2_value,neither_value))

    "MAB" wrote:

    > This is my dilema... I need to display a status of 1 month previous and 2
    > months previous.
    >
    > My problem arises in January and February. What I need in the statement for
    > current month - 1 is: If month(today()) = 1, then 12, else month(today())-1.
    > What I need for the statement current month -2 is: If(month(today()) = 1,
    > then 11, If month(today())= 2, then 12, else month(today())-2. I'm just not
    > certain how to write this in Excel.
    >
    > Thank you.
    >


  3. #3
    Bob Phillips
    Guest

    Re: If, then, else question.

    =CHOOSE(MONTH(TODAY()),12,1,2,3,4,5,6,7,8,9,10,11)

    --
    HTH

    Bob Phillips

    (remove nothere from email address if mailing direct)

    "MAB" <[email protected]> wrote in message
    news:[email protected]...
    > This is my dilema... I need to display a status of 1 month previous and 2
    > months previous.
    >
    > My problem arises in January and February. What I need in the statement

    for
    > current month - 1 is: If month(today()) = 1, then 12, else

    month(today())-1.
    > What I need for the statement current month -2 is: If(month(today()) =

    1,
    > then 11, If month(today())= 2, then 12, else month(today())-2. I'm just

    not
    > certain how to write this in Excel.
    >
    > Thank you.
    >




  4. #4
    MAB
    Guest

    RE: If, then, else question.

    Perfect!

    Thank you.

    "bpeltzer" wrote:

    > =if(month(today())<3,month(today())+10,month(today())-2) is one way.
    > If you want to use nested ifs:
    > =if(month(today())=1,11,if(month(today())=2,12,month(today())-2)))
    > In general:
    > =if(condition_1,cond_1_value,if(condition_2,cond_2_value,neither_value))
    >
    > "MAB" wrote:
    >
    > > This is my dilema... I need to display a status of 1 month previous and 2
    > > months previous.
    > >
    > > My problem arises in January and February. What I need in the statement for
    > > current month - 1 is: If month(today()) = 1, then 12, else month(today())-1.
    > > What I need for the statement current month -2 is: If(month(today()) = 1,
    > > then 11, If month(today())= 2, then 12, else month(today())-2. I'm just not
    > > certain how to write this in Excel.
    > >
    > > Thank you.
    > >


  5. #5
    Registered User
    Join Date
    01-05-2006
    Posts
    65
    Load Analysis Toolpak and use this

    for 1 month prior:
    =MONTH(EDATE(TODAY(),-1))

    for 2 months prior:
    =MONTH(EDATE(TODAY(),-2))

  6. #6
    Ardus Petus
    Guest

    Re: If, then, else question.

    This will automatically adjust to December 2005 if Today is January 2006

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

    HTH
    --
    AP

    "MAB" <[email protected]> a écrit dans le message de
    news:[email protected]...
    > This is my dilema... I need to display a status of 1 month previous and 2
    > months previous.
    >
    > My problem arises in January and February. What I need in the statement

    for
    > current month - 1 is: If month(today()) = 1, then 12, else

    month(today())-1.
    > What I need for the statement current month -2 is: If(month(today()) =

    1,
    > then 11, If month(today())= 2, then 12, else month(today())-2. I'm just

    not
    > certain how to write this in Excel.
    >
    > Thank you.
    >




+ 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