Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 83
Default If function for Current month

I have a column called as Month, and this column contains only Month details
in mmm/yy formate, i need to use the IIF function for some reason, if the
month is current month(Jan/09) and previous month(Dec/08) the result should
be YES,
If its prior to current and previous months(oct/08, nov/08) the result
should be NO
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default If function for Current month

Ranjit,

If your 'Months' are actually formatted dates, then use something like

=IF(AND(A2<=DATE(YEAR(NOW()),MONTH(NOW())+1,0),A2 =DATE(YEAR(NOW()),MONTH(NOW())-1,1)),"YES","NO")

HTH,
Bernie
MS Excel MVP


"Ranjit kurian" wrote in message
...
I have a column called as Month, and this column contains only Month details
in mmm/yy formate, i need to use the IIF function for some reason, if the
month is current month(Jan/09) and previous month(Dec/08) the result should
be YES,
If its prior to current and previous months(oct/08, nov/08) the result
should be NO



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default If function for Current month

Hi Ranjit,

Try (watch for the line wrap):

=IF(AND(YEAR(D2)=YEAR(TODAY())-1,OR(MONTH(TODAY())-MONTH(D2)=0,MONTH(TODAY())-MONTH(D2)=-11)),TRUE,FALSE)

....Where D2 holds your date, then copy down. I have assumed that your dates
although displaying in mmmm/yy format, do hold real dates.

HTH
Bob

"Ranjit kurian" wrote in message
...
I have a column called as Month, and this column contains only Month
details
in mmm/yy formate, i need to use the IIF function for some reason, if the
month is current month(Jan/09) and previous month(Dec/08) the result
should
be YES,
If its prior to current and previous months(oct/08, nov/08) the result
should be NO


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
current week, current month, current year joemeshuggah Excel Programming 1 October 14th 08 06:44 PM
Subtract a future month from the current month to get remaining m. Fletch Excel Worksheet Functions 1 July 26th 07 04:29 PM
Retrieve data for previous 3, 6, 12 month given current month GB Excel Worksheet Functions 4 July 19th 07 11:58 PM
copy worksheet from previous month and rename to current month Dan E. Excel Programming 4 December 8th 05 09:40 PM
User defined function to count pay days in current month. dbmathis Excel Programming 4 August 29th 05 01:43 AM


All times are GMT +1. The time now is 11:20 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"