Return week ending date from Week Number

cazzzac

New Member
Joined
Jul 30, 2012
Messages
19
Hi there,

I have a dataset that is entered daily into the date column (Column B) of a worksheet. Each daily entry has the corresponding week number placed next to it through the WeekNum function (Column A), which has weeks of the year marked as numbers (27, 28, 29, 30 etc.). I am using the week number column to summarise that week's values on another worksheet.

I would like to create a formula on the summary worksheet that returns the week ending date by looking up the friday or saturday value (column B) next to the week number (column A). For example, week number 27 on the summary worksheet, will look for 27 in the WeekNum column on the dataset worksheet, find the text Friday or Saturday, then return the full date value (Friday, 4th July 2014) to the week ending column on the summary worksheet.

Any ideas as to how this could be constructed?

I was thinking the logic would be:
For Week number (27), search for 27 on the dataset sheet in column A; where 27 is found, search for text string 'Friday' in column B, then return the full value for that cell ("Friday, 4th July, 2014")
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Where is the date that your Weeknum uses? It would be easiest to start with that.
 
Upvote 0
The date is on the Dataset sheet, and i want the week ending to go on the Data Summary sheet.
Alternatively, if i could match the week ending against each date entry, i could make that flow through to the Data Summary sheet.
 
Upvote 0
Alternatively, is there a way to create a formula that returns the sixth day of the week based on a particular date? e.g. use the WeekDay function to read a particular date and return the sixth day of the week (the Friday) in relation to that date?
 
Upvote 0
The below formula gives the Firday date of the WEEKNUMBER in B4 cell. Format the cell Custom --> dddd dd/mm/yyyy to show Day & Date.

Code:
=DATE(2014,1,1)+($B$4-1)*7+6-WEEKDAY(DATE(2014,1,1),1)
 
Last edited:
Upvote 0
Mark858 went exactly where I was heading.
 
Upvote 0
Nice one, the only minor issue with Mark's solution is that the Excel WeekNum formula counts Saturday as the final day of the week, while this formula counts Friday. So you end up with a slight mismatch (see image).

I blindly played around a bit with the formula and got it to work for Saturday as the end day.

=A1+7-WEEKDAY(A1+2,2)
changed to
=A1+7-WEEKDAY(A1+2,3)

5zfjev.jpg


Kvsrinivasamurthy's solution also worked against the week number, but i found I couldn't drag the formula for some reason.
 
Last edited:
Upvote 0
the only minor issue.... Excel WeekNum formula counts Saturday as the final day of the week, while this formula counts Friday
that's because you asked for the Friday
read a particular date and return the sixth day of the week (the Friday) in relation to that date

To get the Saturday you can shorten the formula to
=A1+7-WEEKDAY(A1)

Excel Workbook
ABC
1Tue 01/07/201427Sat 05/07/2014
2Wed 02/07/201427Sat 05/07/2014
3Thu 03/07/201427Sat 05/07/2014
4Fri 04/07/201427Sat 05/07/2014
5Sat 05/07/201427Sat 05/07/2014
6Sun 06/07/201428Sat 12/07/2014
7Mon 07/07/201428Sat 12/07/2014
8Tue 08/07/201428Sat 12/07/2014
9Wed 09/07/201428Sat 12/07/2014
10Thu 10/07/201428Sat 12/07/2014
11Fri 11/07/201428Sat 12/07/2014
12Sat 12/07/201428Sat 12/07/2014
13Sun 13/07/201429Sat 19/07/2014
14Mon 14/07/201429Sat 19/07/2014
15Tue 15/07/201429Sat 19/07/2014
16Wed 16/07/201429Sat 19/07/2014
17Thu 17/07/201429Sat 19/07/2014
18Fri 18/07/201429Sat 19/07/2014
19Sat 19/07/201429Sat 19/07/2014
Sheet5
 
Upvote 0

Forum statistics

Threads
1,215,353
Messages
6,124,458
Members
449,161
Latest member
NHOJ

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top