Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default IF calculation using dates - brain hurts

I have a date range:
From:8/5/2009
To: 11/19/2009

I have Month/Year Column and then a Result Column; in the Result Column I
need a formula that will determine if the month and year is within the above
date range.
Jul 09 Formula should return No
Aug 09 Formula should return Yes

Any suggestions?
Thanks
T



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default IF calculation using dates - brain hurts

Where f13 is the from date and f14 is the to date and f15 is the date to
check.
=IF(AND(F15$F$13,F15<=$F$14),"Yes","No")

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Theo" wrote in message
...
I have a date range:
From:8/5/2009
To: 11/19/2009

I have Month/Year Column and then a Result Column; in the Result Column I
need a formula that will determine if the month and year is within the
above
date range.
Jul 09 Formula should return No
Aug 09 Formula should return Yes

Any suggestions?
Thanks
T




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default IF calculation using dates - brain hurts

It doesn't work because the from Date is 8/4/2009 and the date I'm checking
is Aug-2009 (which Excel is reading as 8/1/2009).
Somehow I need the check to be against just the month and year, but I can't
figure out how to do that. OR I need to do some type of LOOKUP where Aug
2009 is a series of dates between 8-1 and 8-31 and the from date just has to
be one of them. But I'm struggling with that one too.
Thanks Don

"Don Guillett" wrote:

Where f13 is the from date and f14 is the to date and f15 is the date to
check.
=IF(AND(F15$F$13,F15<=$F$14),"Yes","No")

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Theo" wrote in message
...
I have a date range:
From:8/5/2009
To: 11/19/2009

I have Month/Year Column and then a Result Column; in the Result Column I
need a formula that will determine if the month and year is within the
above
date range.
Jul 09 Formula should return No
Aug 09 Formula should return Yes

Any suggestions?
Thanks
T





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,059
Default IF calculation using dates - brain hurts

"Theo" wrote:
It doesn't work because the from Date is 8/4/2009 and the date
I'm checking is Aug-2009 (which Excel is reading as 8/1/2009).
Somehow I need the check to be against just the month and year,
but I can't figure out how to do that.


Assuming you are looking for an Excel formula solution, not VBA, one
approach is:

=if(date(year(A1),month(A1),1) = date(year(A2),month(A2),1),"same
month/year","not same month/year")

Note: You can avoid one of the DATE functions if you want to assume that
the cell is always mm/1/yyyy, as Aug-2009 is. In that case:

=if(A1 = date(year(A2),month(A2),1), "same...", "not same...")


----- original message -----

"Theo" wrote in message
...
It doesn't work because the from Date is 8/4/2009 and the date I'm
checking
is Aug-2009 (which Excel is reading as 8/1/2009).
Somehow I need the check to be against just the month and year, but I
can't
figure out how to do that. OR I need to do some type of LOOKUP where Aug
2009 is a series of dates between 8-1 and 8-31 and the from date just has
to
be one of them. But I'm struggling with that one too.
Thanks Don

"Don Guillett" wrote:

Where f13 is the from date and f14 is the to date and f15 is the date to
check.
=IF(AND(F15$F$13,F15<=$F$14),"Yes","No")

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Theo" wrote in message
...
I have a date range:
From:8/5/2009
To: 11/19/2009

I have Month/Year Column and then a Result Column; in the Result
Column I
need a formula that will determine if the month and year is within the
above
date range.
Jul 09 Formula should return No
Aug 09 Formula should return Yes

Any suggestions?
Thanks
T






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default IF calculation using dates - brain hurts

Yahoo! Now I can enjoy the beautiful day outside.
Thanks Joel!!
T

"JoeU2004" wrote:

"Theo" wrote:
It doesn't work because the from Date is 8/4/2009 and the date
I'm checking is Aug-2009 (which Excel is reading as 8/1/2009).
Somehow I need the check to be against just the month and year,
but I can't figure out how to do that.


Assuming you are looking for an Excel formula solution, not VBA, one
approach is:

=if(date(year(A1),month(A1),1) = date(year(A2),month(A2),1),"same
month/year","not same month/year")

Note: You can avoid one of the DATE functions if you want to assume that
the cell is always mm/1/yyyy, as Aug-2009 is. In that case:

=if(A1 = date(year(A2),month(A2),1), "same...", "not same...")


----- original message -----

"Theo" wrote in message
...
It doesn't work because the from Date is 8/4/2009 and the date I'm
checking
is Aug-2009 (which Excel is reading as 8/1/2009).
Somehow I need the check to be against just the month and year, but I
can't
figure out how to do that. OR I need to do some type of LOOKUP where Aug
2009 is a series of dates between 8-1 and 8-31 and the from date just has
to
be one of them. But I'm struggling with that one too.
Thanks Don

"Don Guillett" wrote:

Where f13 is the from date and f14 is the to date and f15 is the date to
check.
=IF(AND(F15$F$13,F15<=$F$14),"Yes","No")

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Theo" wrote in message
...
I have a date range:
From:8/5/2009
To: 11/19/2009

I have Month/Year Column and then a Result Column; in the Result
Column I
need a formula that will determine if the month and year is within the
above
date range.
Jul 09 Formula should return No
Aug 09 Formula should return Yes

Any suggestions?
Thanks
T







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
Calculation Between 2 Dates LF[_2_] Excel Worksheet Functions 11 May 31st 09 12:04 PM
Calculation with dates Vanna Excel Worksheet Functions 1 March 4th 06 06:33 AM
Calculation between two dates Rameris Excel Worksheet Functions 11 January 29th 06 12:13 AM
Arrays Take too long. VERY HARD QUESTION. my head hurts : / belly0fdesire Excel Worksheet Functions 1 August 6th 05 12:47 AM
My brain hurts... Buttaflye Excel Discussion (Misc queries) 2 May 10th 05 06:51 PM


All times are GMT +1. The time now is 06:54 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"