Reverse engineer date

jak82

Board Regular
Joined
Apr 28, 2016
Messages
146
Hi,

I know the year, weekof year and day,

How would I go about reverse engineering it to show the date.

YearWeekDayDate
201726Monday
201726Tuesday
201726Wednesday
201726Thursday

<colgroup><col span="2"><col><col span="2"></colgroup><tbody>
</tbody>

Any help appreciated.

Thanks
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
That formula actually returns each monday of the week, so a quick adjustment (might not be the most elegant):


Excel 2010
ABCD
1YearWeekDayDate
2201726Monday6/26/17
3201726Tuesday6/27/17
4201726Wednesday6/28/17
5201726Thursday6/29/17
Sheet6
Cell Formulas
RangeFormula
D2=(DATE(A2,1,-2)-WEEKDAY(DATE(A2,1,3))+B2*7)-2+MATCH(C2,{"Sunday";"Monday";"Tuesday";"Wednesday";"Thursday";"Friday";"Saturday"},0)
 
Upvote 0
That formula actually returns each monday of the week, so a quick adjustment (might not be the most elegant):

Excel 2010
ABCD
1YearWeekDayDate
2201726Monday6/26/17
3201726Tuesday6/27/17
4201726Wednesday6/28/17
5201726Thursday6/29/17

<colgroup><col style="width: 25pxpx"><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet6

Worksheet Formulas
CellFormula
D2=(DATE(A2,1,-2)-WEEKDAY(DATE(A2,1,3))+B2*7)-2+MATCH(C2,{"Sunday";"Monday";"Tuesday";"Wednesday";"Thursday";"Friday";"Saturday"},0)

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>
You can reduce your formula to two-thirds of its size by replacing the part of your formula that I highlighted in red above with this...

MATCH(LEFT(C2,2),{"Su";"Mo";"Tu";"We";"Th";"Fr";"Sa"},0)
 
Upvote 0
You can reduce your formula to two-thirds of its size by replacing the part of your formula that I highlighted in red above with this...

MATCH(LEFT(C2,2),{"Su";"Mo";"Tu";"We";"Th";"Fr";"Sa"},0)

I thought about that but was too lazy--typed Monday in a cell, dragged it down to get the remaining days, then got the array of constants in another cell with F9. If you type Su, Mo, the autofill doesn't recognize a pattern apparently. What I really wanted was something like Month(1&April) = 4 but for weekdays, not sure Excel has it (at least in 2010).
 
Last edited:
Upvote 0
What I really wanted was something like Month(1&April) = 4 but for weekdays, not sure Excel has it (at least in 2010).
Yeah, I am pretty sure no version of Excel would do that. By the way, an even shorter replacement (more than half) of what I highlighted in Message #5 would be this...

=(FIND(LEFT(C2,2),"SuMoTuWeThFrSa")+1)/2
 
Upvote 0

Forum statistics

Threads
1,215,223
Messages
6,123,727
Members
449,116
Latest member
Aaagu

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