Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VLookup between 2 dates

Status
Not open for further replies.

MrDougJ

Technical User
Feb 25, 2009
8
US
Hi,
I am using date periods which do not correspond to each month ie 12 Jan - 24 Jan = Period 1; 25 Jan - 27 Feb = Period 2 etc. These are listed in a table.
How can I write a lookup statement which will return what period a specific date is in - for example, if the date is 14 Jan, period 1 will be returned?
Thanks for your help
Doug
 
Use vlookup with a 4th argument set to true and a lookup table as follows:

12/01/2009 1
25/01/2009 2
28/02/2009 3

if this data is in A1:B3 then your sample vlookup would be:

=vlookup(DateRef,$A$1:$B$3,2,true)

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top