Date EndOfWeek Returns Saturday Instead of Sunday

wsnyder

Board Regular
Joined
Sep 23, 2018
Messages
224
Office Version
  1. 365
Platform
  1. Windows
Hi all,

Using Excel M365 Beta.

I entered 1/1/2022 into a cell and import into PQ
I added a custom column and entered the formula:
Rich (BB code):
Date.EndOfWeek(#date(Date.Year([Column1]),
Date.Month([Column1]),
Date.Day([Column1])),Day.Sunday)
But it is returning 1/1/2022.
But I expect 1/2/2022.

1/1/2022 was Saturday
1/2/2022 was Sunday

What am I doing wrong?

Thanks
-w
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Got it.
I thought the argument was calling for the last day of the week, but it is asking for the first day of the week so Day.Monday
Work great.

Here is the final PQ Formula I entered for the Custom Column


Rich (BB code):
Date.EndOfWeek(#date(Date.Year([Column1]),
Date.Month([Column1]),
Date.Day([Column1])),Day.Monday)

Thanks
-w
 
Upvote 0
Solution

Forum statistics

Threads
1,223,669
Messages
6,173,693
Members
452,527
Latest member
ineedexcelhelptoday

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