Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
Hello everyone,
I need a formula that states: If (d1 (which is a date format) = January 2005,then return b10,if(d1 date = February, then return b11,otherwise return 0)). I have tried several ways, my formula does not seem to acknowledge the date value. What am I doing wrong? Any suggestions? Thanks |
#2
![]() |
|||
|
|||
![]()
The problem is that you are trying to compare apples and oranges. If you
have a date in a cell, no matter what the format, there is always a month, day and year component. So if you want to see if a date, for example, January 10, 2005, is in January 2005, then you have to break down the date to check only the month and year components, such as: =IF(AND(MONTH(D1)=1,YEAR(D1)=2005),B10,IF(AND(MONT H(D1)=2,YEAR(D1)=2005),B10 ,0)) Make sure there are no line breaks after you copy this into your formula bar or it will not work. HTH "taxmom" wrote in message ... Hello everyone, I need a formula that states: If (d1 (which is a date format) = January 2005,then return b10,if(d1 date = February, then return b11,otherwise return 0)). I have tried several ways, my formula does not seem to acknowledge the date value. What am I doing wrong? Any suggestions? Thanks |
#3
![]() |
|||
|
|||
![]()
OH, THANK YOU SOOO MUCH!
This is perfect! Have a great T.G.I.F Day! You just made my day! "Michael Malinsky" wrote: The problem is that you are trying to compare apples and oranges. If you have a date in a cell, no matter what the format, there is always a month, day and year component. So if you want to see if a date, for example, January 10, 2005, is in January 2005, then you have to break down the date to check only the month and year components, such as: =IF(AND(MONTH(D1)=1,YEAR(D1)=2005),B10,IF(AND(MONT H(D1)=2,YEAR(D1)=2005),B10 ,0)) Make sure there are no line breaks after you copy this into your formula bar or it will not work. HTH "taxmom" wrote in message ... Hello everyone, I need a formula that states: If (d1 (which is a date format) = January 2005,then return b10,if(d1 date = February, then return b11,otherwise return 0)). I have tried several ways, my formula does not seem to acknowledge the date value. What am I doing wrong? Any suggestions? Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Date Function | Excel Worksheet Functions | |||
Today() or Date() function help | Excel Discussion (Misc queries) | |||
Excel :Save date function | Excel Worksheet Functions | |||
Formula for date function | Excel Worksheet Functions | |||
Another date function question | Excel Worksheet Functions |