Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Checking a date/number between two others

I often have a need to compare a date with two other dates and see
whether dateA is between dateB and dateC. I have tried to use the "IF"
function but it doesn't seem to take arguments as complicated as "IF
((A=B) and (A<=C))" which is basically what I am asking. I've been
having to use two different T/F columns and just take the ones that
are TRUE in both, but that is very cumbersome. Is there a more
sophisticated way to ask if A is between B and C?

Thanks...
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Checking a date/number between two others

Another one:

=A1=MEDIAN(A1:C1)

--
Biff
Microsoft Excel MVP


wrote in message
...
I often have a need to compare a date with two other dates and see
whether dateA is between dateB and dateC. I have tried to use the "IF"
function but it doesn't seem to take arguments as complicated as "IF
((A=B) and (A<=C))" which is basically what I am asking. I've been
having to use two different T/F columns and just take the ones that
are TRUE in both, but that is very cumbersome. Is there a more
sophisticated way to ask if A is between B and C?

Thanks...



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Checking a date/number between two others

Thanks to both of you! I knew there was something I was missing!
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Checking a date/number between two others

On Mar 27, 5:20 pm, "T. Valko" wrote:
Another one:

=A1=MEDIAN(A1:C1)


Actually I don't think this would work, because I am not always
looking for the MEDIAN of the two dates (plus your formula as written
is self-referential). Lars-Åke's suggestion is exactly what I needed,
but thanks anyway!

Kent



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 806
Default Checking a date/number between two others

Hello Kent,

Biff's MEDIAN solution works.

Another approach:
=(A1=B1)*(A1<=C1)

Regards,
Bernd
  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Checking a date/number between two others

=IF (AND(A1=B1,A1<=C1),"between","not between")
=A1=MEDIAN(A1:C1)


If the date/number in C1 is always greater than or equal to the date/number
in B1 those formulas are checking for the *exact same thing*. The only
difference is the MEDIAN formula returns either TRUE or FALSE

Try it like this and you'll get identical results from both formulas.

=IF(A1=MEDIAN(A1:C1),"between","not between")
=IF(AND(A1=B1,A1<=C1),"between","not between")



--
Biff
Microsoft Excel MVP


wrote in message
...
On Mar 27, 5:20 pm, "T. Valko" wrote:
Another one:

=A1=MEDIAN(A1:C1)


Actually I don't think this would work, because I am not always
looking for the MEDIAN of the two dates (plus your formula as written
is self-referential). Lars-Åke's suggestion is exactly what I needed,
but thanks anyway!

Kent


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
number checking diam Excel Discussion (Misc queries) 0 November 29th 06 05:46 PM
number checking diam Excel Discussion (Misc queries) 0 November 29th 06 05:35 PM
Checking if a number appears within a cell moonrabbit Excel Discussion (Misc queries) 3 May 4th 06 06:38 PM
Checking a number of sheets sphenisc Excel Worksheet Functions 1 November 17th 05 06:55 PM
Checking cell for Number Lee New Users to Excel 2 October 11th 05 09:23 PM


All times are GMT +1. The time now is 03:46 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"