close

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.=if(month(today())lt;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,mon th(today())-2)))
In general:
=if(condition_1,cond_1_value,if(condition_2,cond_2 _value,neither_value))

quot;MABquot; wrote:

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

=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)

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

Thank you.

quot;bpeltzerquot; wrote:

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


Load Analysis Toolpak and use this

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

for 2 months prior:
=MONTH(EDATE(TODAY(),-2))--
mphell0
------------------------------------------------------------------------
mphell0's Profile: www.excelforum.com/member.php...oamp;userid=30153
View this thread: www.excelforum.com/showthread...hreadid=519486This will automatically adjust to December 2005 if Today is January 2006

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

HTH
--
AP

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

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()