View Full Version : Solved: Look up a date range
Pizzafiend
05-30-2006, 08:27 AM
Greetings,
I am trying to look up a date range (for example 04/01/06-04/30/06) and retrieve every name that falls within that range.
Any help would be appreciated.
Regards,
Danny:banghead:
Might need a bit more info than you have given Danny - what 'Names' are you trying to retrieve? - can you include an example speadsheet for us to look at?
Thanks,
Apps
austenr
05-30-2006, 09:01 AM
Something like this perhaps. Uses a name range called "dates"
Option Explicit
Sub getdateinfo()
Dim myrange As Range
For Each myrange In Range("dates")
If myrange.Value > "03/31/2006" And myrange.Value < "05/01/2006" Then
"What you want to do here"
End If
Next
End Sub
Shazam
06-01-2006, 09:09 AM
See if this helps you.
Assuming your dates are in column A and your names are in column B.
=INDEX($B$2:$B$100,SMALL(IF($A$2:$A$100>=$D$2,IF($A$2:$A$100<=$E$2,ROW($B$2:$B$100)-ROW($B$2)+1)),ROW(A1)))
Sample attachment below.
Must be confirmed with:
Control+Shift+Enter
lenze
06-01-2006, 09:30 AM
Pivot Table? Grouped by month?? days??
lenze
Pizzafiend
06-01-2006, 09:49 AM
Thanks for all the help guys. It works now.
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.