Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Lookup Formula

In Excel2000, I have the following data:

Weekending Fiscal Month
2/19/2005 FEB
2/26/2005 FEB
3/5/2005 MAR
3/12/2005 MAR

I want to have a lookup formula that looks up all dates before the
weekending date. For example for the following:

2/25/2005 = Feb
2/26/2005 = Feb
2/27/2005 = Mar
2/28/2005 = Mar
2/29/2005 = Mar
3/1/2005= Mar

Thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default Lookup Formula

"snax500" wrote:
I want to have a lookup formula that looks up all dates before the
weekending date.


I'm not sure what it is you're after: do you want to be told the week ending
date for a given date, or do you want a list of all the dates for the week
that ends on a given date? If you really want a lookup, what's it supposed
to do?

In the first case,

Public Function WeekendingDate(day As Date) As Date
'could use some parameter checking... day < 0, etc.
Dim daynumber As Integer
daynumber = Weekday(day)
WeekendingDate = day + 7 - daynumber
End Function

In the second case, just use date arithmetic: day - 1, day - 2, etc.

Or were you after something else?
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
Utilizing a RANDBETWEEN() formula within a LOOKUP formula Rich Werk. Excel Discussion (Misc queries) 4 November 4th 09 03:01 AM
need help with lookup formula Gil[_2_] Excel Worksheet Functions 5 January 31st 08 03:09 AM
Lookup and Use a Formula TKS_Mark Excel Discussion (Misc queries) 8 January 5th 08 01:45 AM
Lookup formula Rowland Excel Worksheet Functions 2 February 1st 07 03:29 PM
Lookup Formula - but have a formula if it can't find/match a value Stephen Excel Worksheet Functions 11 June 14th 05 05:32 AM


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