Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Mileage Claim Formula | New Users to Excel | |||
Minimum Date Range from other cells | Excel Worksheet Functions | |||
checking that cells have a value before the workbook will close | Excel Worksheet Functions | |||
Match function...random search? | Excel Worksheet Functions | |||
Count cells based on date range in another column | New Users to Excel |