Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
NN NN is offline
external usenet poster
 
Posts: 11
Default return a date from range, date is between dates in two other cells

I have a range of dates, S2:AF2. I need to search within that range to
locate any that are between the dates in two other cells, AG2 and AH2. If
none are between the dates, I wish the calculated cell to remain blank.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default return a date from range, date is between dates in two other cells

A formula like:
=COUNTIF(S2:AF2,""&AG2) - COUNTIF(S2:AF2,"="&AH2)
(AG2 holds the earlier date. AH2 holds the later date.)



So you could do:
=if((COUNTIF(S2:AF2,""&AG2) - COUNTIF(S2:AF2,"="&AH2))=0,"",yourformulahere)

if you don't know which date will be earlier or later, you could use:
=COUNTIF(S2:AF2,""&min(AG2,ah2)) - COUNTIF(S2:AF2,"="&max(ag2,AH2))

And I'm not sure what should happen at the cusps--when the dates are equal to
the AG2 and AH2. You may have to fiddle with the inequalities.



NN wrote:

I have a range of dates, S2:AF2. I need to search within that range to
locate any that are between the dates in two other cells, AG2 and AH2. If
none are between the dates, I wish the calculated cell to remain blank.


--

Dave Peterson
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
Mileage Claim Formula johndavies New Users to Excel 4 August 14th 06 09:24 AM
Minimum Date Range from other cells JLT Excel Worksheet Functions 1 January 1st 06 08:29 PM
checking that cells have a value before the workbook will close kcdonaldson Excel Worksheet Functions 8 December 5th 05 04:57 PM
Match function...random search? Les Excel Worksheet Functions 10 July 28th 05 11:54 AM
Count cells based on date range in another column [email protected] New Users to Excel 1 May 5th 05 08:11 PM


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