Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
MAB
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
bpeltzer
 
Posts: n/a
Default 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,mon th(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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
MAB
 
Posts: n/a
Default 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,mon th(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.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
mphell0
 
Posts: n/a
Default If, then, else question.


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: http://www.excelforum.com/member.php...o&userid=30153
View this thread: http://www.excelforum.com/showthread...hreadid=519486

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default 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" wrote in message
...
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.





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ardus Petus
 
Posts: n/a
Default 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" a écrit dans le message de
...
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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is this the proper place to ask my question? amkazen Excel Discussion (Misc queries) 1 March 1st 06 05:20 PM
Finding and deleting question marks jezzica85 Excel Discussion (Misc queries) 3 February 25th 06 09:05 AM
Summary Page Question EyeNoNothing via OfficeKB.com Excel Discussion (Misc queries) 1 February 18th 06 10:03 PM
Pivot table question gary Excel Discussion (Misc queries) 1 January 10th 06 06:25 PM
How do I find and replace a question mark in Excel? Ranpalandil Excel Discussion (Misc queries) 1 September 7th 05 10:20 PM


All times are GMT +1. The time now is 02:08 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"