you can use following function to get date range instead of a vlookup: Function GetDateRange(Day1 As Date, CurrentDay As Date) As String Dim i As Integer, LeftRange As Date, RightRange As Date If Day1 > CurrentDay Then DateRange = "#INVALID#" Exit Function End If i = Application.WorksheetFunction.RoundDown((CurrentDay - Day1) / 7, 0) LeftRange = 7 * (i) + (Day1) RightRange = 7 * (i + 1) + (Day1 - 1) GetDateRange = Format(LeftRange, "dd-mmm") & " to " & Format(RightRange, "dd-mmm") End Function
If you want to convert date into Day names, use Text function = TEXT(YourDate,"ddd") _________________________________________________________________________________________________ "There are known knowns. These are things we know that we know. There are known unknowns. That is to say, there are things that we know we don't know. But there are also unknown unknowns. There are things we don't know we don't know." ________________________________ From: Sachin Gohil <sachin.go...@hotmail.com> To: excel-macros@googlegroups.com Sent: Mon, 11 January, 2010 9:28:00 PM Subject: RE: $$Excel-Macros$$ Vlookup-Dates Its very simple data. For every date I want Mon-Sun for that date. File 1: Date Week 15-Jan-09 =vlookup(A2,File2,2,0) which gives #N/A File 2: Date Week 11-Jan-09 11-Jan to 17-Jan 12-Jan-09 11-Jan to 17-Jan 13-Jan-09 11-Jan to 17-Jan 14-Jan-09 11-Jan to 17-Jan 15-Jan-09 11-Jan to 17-Jan 16-Jan-09 11-Jan to 17-Jan 17-Jan-09 11-Jan to 17-Jan 18-Jan-09 18-Jan to 24-Jan 19-Jan-09 18-Jan to 24-Jan ________________________________ Date: Sun, 10 Jan 2010 09:10:23 -0800 From: alokeshwar.tiw...@yahoo.com Subject: Re: $$Excel-Macros$$ Vlookup-Dates To: excel-macros@googlegroups.com Please share the workbook? _________________________________________________________________________________________________ "There are known knowns. These are things we know that we know. There are known unknowns. That is to say, there are things that we know we don't know. But there are also unknown unknowns. There are things we don't know we don't know." ________________________________ From: Sachin Gohil <sachin.go...@hotmail.com> To: excel-macros@googlegroups.com Sent: Sun, 10 January, 2010 7:00:44 PM Subject: $$Excel-Macros$$ Vlookup-Dates Dear All, I did a vlookup of dates, but Im getting #N/A. The reason is every date in excel is tored as serial no. Tried using Date/Date value but it doesnt work.. ________________________________ New Windows 7: Find the right PC for you. Learn more. -- ---------------------------------------------------------------------------------- Some important links for excel users: 1. Follow us in TWITTER for tips tricks and links : http://twitter.com/exceldailytip 2. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at http://www.excelitems.com 3. Excel tutorials at http://www.excel-macros.blogspot.com 4. Learn VBA Macros at http://www.quickvba.blogspot.com 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com If you find any spam message in the group, please send an email to: Ayush Jain @ jainayus...@gmail.com <><><><><><><><><><><><><><><><><><><><><><> HELP US GROW !! We reach over 6,500 subscribers worldwide and receive many nice notes about the learning and support from the group.Let friends and co-workers know they can subscribe to group at http://groups.google.com/group/excel-macros/subscribe ________________________________ The INTERNET now has a personality. YOURS! See your Yahoo! Homepage. ________________________________ Windows 7: Find the right PC for you. Learn more. -- ---------------------------------------------------------------------------------- Some important links for excel users: 1. Follow us in TWITTER for tips tricks and links : http://twitter.com/exceldailytip 2. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at http://www.excelitems.com 3. Excel tutorials at http://www.excel-macros.blogspot.com 4. Learn VBA Macros at http://www.quickvba.blogspot.com 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com If you find any spam message in the group, please send an email to: Ayush Jain @ jainayus...@gmail.com <><><><><><><><><><><><><><><><><><><><><><> HELP US GROW !! We reach over 6,500 subscribers worldwide and receive many nice notes about the learning and support from the group.Let friends and co-workers know they can subscribe to group at http://groups.google.com/group/excel-macros/subscribe The INTERNET now has a personality. YOURS! See your Yahoo! Homepage. http://in.yahoo.com/
-- ---------------------------------------------------------------------------------- Some important links for excel users: 1. Follow us in TWITTER for tips tricks and links : http://twitter.com/exceldailytip 2. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at http://www.excelitems.com 3. Excel tutorials at http://www.excel-macros.blogspot.com 4. Learn VBA Macros at http://www.quickvba.blogspot.com 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com If you find any spam message in the group, please send an email to: Ayush Jain @ jainayus...@gmail.com <><><><><><><><><><><><><><><><><><><><><><> HELP US GROW !! We reach over 6,500 subscribers worldwide and receive many nice notes about the learning and support from the group.Let friends and co-workers know they can subscribe to group at http://groups.google.com/group/excel-macros/subscribe
Book1.xls
Description: MS-Excel spreadsheet