ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   conditional formula (https://www.excelbanter.com/excel-worksheet-functions/166283-conditional-formula.html)

MMG

conditional formula
 
I am trying to figure out how to use a conditional formula to say that if the
month in a cell containing a full date (i.e. 10/23/06) is Jan then.... or if
the month is Feb then...any suggestions?

Bernard Liengme

conditional formula
 
That is going to be a problem since we can nest IF only 7 deep (unless you
have XL 2007)
We can begin with =IF(MONTH(A1)=1,"its Jan", IF(MONTH(A1)=2, "its Feb",....
but that would need 12 IFs.
Perhaps if we knew what you need after "IS JAN THEN ...." we might be able
to propose another solution.
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
www.stfx.ca/people/bliengme
remove caps from email

"MMG" wrote in message
...
I am trying to figure out how to use a conditional formula to say that if
the
month in a cell containing a full date (i.e. 10/23/06) is Jan then.... or
if
the month is Feb then...any suggestions?




T. Valko

conditional formula
 
If you want to check for all 12 of the months then you'll have to tell us
what the "then" is. Based on your question as posted (check for either Jan
or Feb):

A1 = some date

=IF(MONTH(A1)=1,"then this",IF(MONTH(A1)=2,"then this",""))

If A1 is EMPTY it will evaluate as month 1 so you might want to make sure it
has a date:

=IF(AND(ISNUMBER(A1),MONTH(A1)=1),"then this",IF(MONTH(A1)=2,"then
this",""))

If you want to check for all 12 of the months then a lookup table and a
lookup formula will probably be a better solution.


--
Biff
Microsoft Excel MVP


"MMG" wrote in message
...
I am trying to figure out how to use a conditional formula to say that if
the
month in a cell containing a full date (i.e. 10/23/06) is Jan then.... or
if
the month is Feb then...any suggestions?





All times are GMT +1. The time now is 05:51 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com