View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Frank Kabel Frank Kabel is offline
external usenet poster
 
Posts: 3,885
Default Between dates table lookup.

Hi
formula solution:
=VLOOKUP(TODAY(),A1:C100,3,TRUE)

Note: you have to sort column A scending

--
Regards
Frank Kabel
Frankfurt, Germany
schrieb im Newsbeitrag
...
Hello,


Ok I have the following table:

In column A there are a list of dates - the start date of the week.
In columns B there is another list of dates - the end date of the
week.
In column C there is a code.

For example:


A B C
06/12/04 12/12/04 1234
13/12/04 19/12/04 5678
2012/04 26/12/04 9101


and so on.


I would either like to create a forumula for a cell, or some VB code
that I could attach to a command button that would get the current
date, then check to see if it falls on or between the dates in column
A & B, then return the correpsonding code from C.

e.g.

If today's date is 14/12/04, the formula or code would look in column
A & B, find that it falls beween the dates 13/12/04 & 19/12/04, then
return the code "5678."

I'm not sure how to go about this... any help appreciated!

thanks


Michael