Excel - find last day of that week

Eisasuarez

Well-known Member
Joined
Mar 23, 2012
Messages
653
Hi

I have dates in column A and Values in Column B

Now say i input a date in D1 = 04/01/2016

In E1, how can i return the last date found for that week looking into column A?

so say the last date for that week was 08/01/2016 - i would want it to return that date..

thank you
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
What result you expect in E1 if D1 = 09/01/2016 (i.e. January 9th 2016)? Do you want the last day to be the last workday which would be Friday?
 
Last edited:
Upvote 0
Try this
=A1+(7-WEEKDAY(A1))
I had to read the question a few times myself, I don't think this is what they are after.
It sounds to me like they have a list of dates in column A, and for any given week, they want to know the date of the latest day for that week that appears in column A.
So, it could be a Thursday, a Friday, etc. depending on the dates in column A.

One follow-up question to the original question though. For your purposes, what is the last day in your week? Is it Saturday, or are you looking more for a work week, meaning Friday?
 
Upvote 0
This is what I took from the question.


Excel 2010
ABCDE
1DateDateResult
29/12/20169/13/20169/15/2016
39/13/2016
49/14/2016
59/15/2016
69/17/2016
79/18/2016
89/19/2016
99/20/2016
109/21/2016
119/22/2016
129/23/2016
139/24/2016
149/25/2016
159/26/2016
169/27/2016
Sheet1


You would expect the answer to be Friday 9/16/2016 but since that isn't in column A, it finds the next closest date in that week that is in column A.
 
Last edited:
Upvote 0
Hi Joe - yes you are right- i need the last day found in the week in column A - the week could go upto Sunday
 
Upvote 0
Not sure if my logic is correct here but see if this works


Excel 2010
ABCDE
1DateDateResult
29/12/20169/12/20169/18/2016
39/13/2016
49/14/2016
59/15/2016
69/17/2016
79/18/2016
89/19/2016
99/20/2016
109/21/2016
119/22/2016
129/23/2016
139/24/2016
149/25/2016
159/26/2016
169/27/2016
Sheet1
Cell Formulas
RangeFormula
E2=INDEX(A2:A16,MATCH(D2+(8-WEEKDAY(D2)),A2:A16,1))


Edit: Realized this won't work if the input date is a Sunday, it returns the following Sunday date.
 
Last edited:
Upvote 0
Edit: Realized this won't work if the input date is a Sunday, it returns the following Sunday date.
Also doesn't seem to work in other situations.

For example, in column A, let's say that we have the dates 1/4/2016, 1/5/2016, and 1/8/2016 among other dates in other weeks.
In column D, if our date is 1/4/2016, it should return 1/8/2016. But the formula you posted returns 1/5/2016.

I think I have a solution that works, but it involves using "helper" columns, if the OP is open to that idea...
 
Upvote 0

Forum statistics

Threads
1,225,111
Messages
6,182,891
Members
453,139
Latest member
Deepinmind

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