Change dates to weekly

CHML

Board Regular
Joined
Mar 19, 2023
Messages
73
Office Version
  1. 2019
Platform
  1. Windows
  2. Web
Hi. How could I get an average amount per week? Let's say from Sat - Fri. Also, is there a way I could format dates from the current view to a weekly cycle? e.g. A3:A8 should all be the last Friday of that week to show all these dates belong to this billing cycle.

1691094879867.png

So it would look like this
1691095289983.png


Once I get it like this I could quickly get it done via a Pivot Table.

Thank you in advance.
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
As far as the first part of your requirement goes (converting all dates to Fridays) - please try the following on a copy of your data. Just change the sheet name to suit.
VBA Code:
Option Explicit
Sub Fridays()
    Dim ws As Worksheet
    Set ws = Worksheets("Sheet1")       '<~~ *** Change to actual sheet name ***
    With ws.Range("A3", ws.Cells(Rows.Count, "A").End(xlUp))
        .Value2 = Evaluate(.Address(, , , 1) & "+7-WEEKDAY(" & .Address(, , , 1) & "+1)")
    End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,331
Members
452,636
Latest member
laura12345

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