View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bernie Deitrick Bernie Deitrick is offline
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