Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 12
Default return TRUE if a date falls between two dates

I am looking for an "IF" statement to send back "T" or "F" (true/false), if
the date entered falls between two dates from a list, for all 5 rows...

The date entered, lets say in A5, of the "Sched" worksheet.

On the "Dates" worksheet, Column A are starting dates, Column B are end
dates. The cells are (group reference??) labelled "StartD" and "EndD".

A B Examples
11/01/07 28/01/07 Daycare
04/02/07 19/03/07 Community Service
28/03/07 09/05/07 Intern

Eventually, the true/false will be used for 3 other conditional formats and
calculations. I've tried VLOOKUP but can't figure my way around it. Any
help you can provide would be appreciated!

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 623
Default return TRUE if a date falls between two dates

One way:

=if(and(a5a2,a5<b2),true,false)

--
Regards,
Fred


"christine b" wrote in message
...
I am looking for an "IF" statement to send back "T" or "F" (true/false), if
the date entered falls between two dates from a list, for all 5 rows...

The date entered, lets say in A5, of the "Sched" worksheet.

On the "Dates" worksheet, Column A are starting dates, Column B are end
dates. The cells are (group reference??) labelled "StartD" and "EndD".

A B Examples
11/01/07 28/01/07 Daycare
04/02/07 19/03/07 Community Service
28/03/07 09/05/07 Intern

Eventually, the true/false will be used for 3 other conditional formats and
calculations. I've tried VLOOKUP but can't figure my way around it. Any
help you can provide would be appreciated!



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default return TRUE if a date falls between two dates

=IF(SUMPRODUCT(--(StartD<=A5),--(EndD=A5)),"T","F")


"christine b" wrote:

I am looking for an "IF" statement to send back "T" or "F" (true/false), if
the date entered falls between two dates from a list, for all 5 rows...

The date entered, lets say in A5, of the "Sched" worksheet.

On the "Dates" worksheet, Column A are starting dates, Column B are end
dates. The cells are (group reference??) labelled "StartD" and "EndD".

A B Examples
11/01/07 28/01/07 Daycare
04/02/07 19/03/07 Community Service
28/03/07 09/05/07 Intern

Eventually, the true/false will be used for 3 other conditional formats and
calculations. I've tried VLOOKUP but can't figure my way around it. Any
help you can provide would be appreciated!

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 12
Default return TRUE if a date falls between two dates

it works! you're a genious! :o)
For my humble education, can you tell me what "--" does in this formula?

Mucly appreciated.
Christine


"Teethless mama" wrote:

=IF(SUMPRODUCT(--(StartD<=A5),--(EndD=A5)),"T","F")


"christine b" wrote:

I am looking for an "IF" statement to send back "T" or "F" (true/false), if
the date entered falls between two dates from a list, for all 5 rows...

The date entered, lets say in A5, of the "Sched" worksheet.

On the "Dates" worksheet, Column A are starting dates, Column B are end
dates. The cells are (group reference??) labelled "StartD" and "EndD".

A B Examples
11/01/07 28/01/07 Daycare
04/02/07 19/03/07 Community Service
28/03/07 09/05/07 Intern

Eventually, the true/false will be used for 3 other conditional formats and
calculations. I've tried VLOOKUP but can't figure my way around it. Any
help you can provide would be appreciated!

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default return TRUE if a date falls between two dates

Double unary "--" converts TRUE/FALE to 1/0 it is same as

=IF(SUMPRODUCT((StartD<=A5)*(EndD=A5)),"T","F")


"christine b" wrote:

it works! you're a genious! :o)
For my humble education, can you tell me what "--" does in this formula?

Mucly appreciated.
Christine


"Teethless mama" wrote:

=IF(SUMPRODUCT(--(StartD<=A5),--(EndD=A5)),"T","F")


"christine b" wrote:

I am looking for an "IF" statement to send back "T" or "F" (true/false), if
the date entered falls between two dates from a list, for all 5 rows...

The date entered, lets say in A5, of the "Sched" worksheet.

On the "Dates" worksheet, Column A are starting dates, Column B are end
dates. The cells are (group reference??) labelled "StartD" and "EndD".

A B Examples
11/01/07 28/01/07 Daycare
04/02/07 19/03/07 Community Service
28/03/07 09/05/07 Intern

Eventually, the true/false will be used for 3 other conditional formats and
calculations. I've tried VLOOKUP but can't figure my way around it. Any
help you can provide would be appreciated!



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,202
Default return TRUE if a date falls between two dates

=IF(SUMPRODUCT(--(StartD<=A5),--(EndD=A5)),"T","F")

I wasn't entirely clear from Christine's posting which conditionals should
be considered True and which False; but assuming she liked the results your
formula yielded, I think this formula will work also....

=MID("FT",1+(StartD<=A5)*(EndD=A5),1)

Rick

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default return TRUE if a date falls between two dates

See http://www.xldynamic.com/source/xld.SUMPRODUCT.html for a detailed
explanation.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"christine b" wrote in message
...
it works! you're a genious! :o)
For my humble education, can you tell me what "--" does in this formula?

Mucly appreciated.
Christine


"Teethless mama" wrote:

=IF(SUMPRODUCT(--(StartD<=A5),--(EndD=A5)),"T","F")


"christine b" wrote:

I am looking for an "IF" statement to send back "T" or "F"
(true/false), if
the date entered falls between two dates from a list, for all 5 rows...

The date entered, lets say in A5, of the "Sched" worksheet.

On the "Dates" worksheet, Column A are starting dates, Column B are end
dates. The cells are (group reference??) labelled "StartD" and "EndD".

A B Examples
11/01/07 28/01/07 Daycare
04/02/07 19/03/07 Community Service
28/03/07 09/05/07 Intern

Eventually, the true/false will be used for 3 other conditional formats
and
calculations. I've tried VLOOKUP but can't figure my way around it.
Any
help you can provide would be appreciated!



  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 12
Default return TRUE if a date falls between two dates

Rick,
not sure what this formula is doing, so I can't say what is wrong once I've
transfered to my sheet. it's flawed in that it does not find all dates -
maybe i've done something too. To be more clear: I enter a date in cell
A1. I want a formula to search the list and return true or false if I was
busy that day.

TeethlessMoma's formula works for this pupose, and I am also able to adapt
it to also flag false if the A1 date is a holiday or weekend.

here's what I did:
=IF(OR(SUMPRODUCT(--(PLQStart<=C33),--(PLQEnd=C33)),WEEKDAY(C33,2)=6,NOT(ISNA(VLOOKUP( C33,Holidays,1,FALSE)))),"","o")

If you can find an easier way for the above, I'm all ears!!! So far, I'm
amazed with what I've done with the excel help file, and this posting.



"Rick Rothstein (MVP - VB)" wrote:

=IF(SUMPRODUCT(--(StartD<=A5),--(EndD=A5)),"T","F")


I wasn't entirely clear from Christine's posting which conditionals should
be considered True and which False; but assuming she liked the results your
formula yielded, I think this formula will work also....

=MID("FT",1+(StartD<=A5)*(EndD=A5),1)

Rick


  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 12
Default return TRUE if a date falls between two dates

just for some additional detail for what I am doing? I've used this
formula in each cell of a calandar so that tells me weekdays that I did not
work (excluding wknds and holidays).

"Rick Rothstein (MVP - VB)" wrote:

=IF(SUMPRODUCT(--(StartD<=A5),--(EndD=A5)),"T","F")


I wasn't entirely clear from Christine's posting which conditionals should
be considered True and which False; but assuming she liked the results your
formula yielded, I think this formula will work also....

=MID("FT",1+(StartD<=A5)*(EndD=A5),1)

Rick


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
Need true or false if a date falls between a date range dustin Excel Worksheet Functions 3 December 9th 06 02:01 AM
Search for 2 true arguments and return true or false David Excel Discussion (Misc queries) 3 July 15th 06 10:18 AM
Function to return True/False if all are validated as True by ISNU Tetsuya Oguma Excel Worksheet Functions 2 March 15th 06 10:28 AM
Return a specified date when it falls within a range.... Nokose451 Excel Discussion (Misc queries) 1 January 16th 06 10:06 PM
How to find if a date falls between 2 dates JHL Excel Worksheet Functions 4 December 19th 05 05:46 PM


All times are GMT +1. The time now is 01:05 PM.

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"