Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
taxmom
 
Posts: n/a
Default If Function with Date

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   Report Post  
Michael Malinsky
 
Posts: n/a
Default

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   Report Post  
taxmom
 
Posts: n/a
Default

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
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
Date Function drschieff Excel Worksheet Functions 1 January 19th 05 07:51 PM
Today() or Date() function help julisimo Excel Discussion (Misc queries) 8 January 3rd 05 04:19 PM
Excel :Save date function Elodie Excel Worksheet Functions 1 November 25th 04 04:25 PM
Formula for date function Markitos Excel Worksheet Functions 15 November 10th 04 02:05 AM
Another date function question mendozalaura Excel Worksheet Functions 1 November 5th 04 04:26 PM


All times are GMT +1. The time now is 10:28 PM.

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"