How to Get Previous Sunday in Excel

Learn multiple Excel methods to get previous Sunday with step-by-step examples, troubleshooting tips, and real-world applications.

excelformulaspreadsheettutorial
12 min read • Last updated: 7/2/2025

How to Get Previous Sunday in Excel

Why This Task Matters in Excel

In scheduling, reporting, and time-based analysis, many organisations slice data into calendar weeks that start on a Sunday. Payroll departments often close each pay period on the Saturday night that precedes a new payroll week beginning Sunday morning. Retail chains measure weekly sales from Sunday to Saturday because those boundaries align with consumer traffic patterns. Marketing teams schedule e-mail campaigns so that messages hit inboxes on Sunday evenings, a strategy that demands precise calculations of “the last Sunday before send-date” when building automation triggers.

Without an automated way to fetch the previous Sunday, analysts resort to manual calendar look-ups. This slows down workflows, invites accidental off-by-one errors, and breaks whenever reporting dates change. Worse, manual corrections ripple across linked worksheets, pivot tables, and dashboards, jeopardising data integrity.

Excel excels (pun intended) at date math because its date system stores every calendar day as a sequential number. With the right formula, we can let Excel do the calendar counting under the hood, guaranteeing that “previous Sunday” is always correct—whether the source date is yesterday, today, or three years in the future. Mastering this task connects directly to other must-have skills: dynamic rolling reports, automatic period grouping in Power Pivot, and calendar-table creation for Power BI. If you can nail “previous Sunday,” concepts such as “previous month-end,” “next working day,” or “nth weekday in quarter” all follow the same pattern.

Finally, knowing multiple approaches prepares you for the diversity of Excel environments. Some organisations remain on pre-2010 versions without dynamic arrays; others live in Microsoft 365 with LET and LAMBDA. A rock-solid tool kit lets you deliver consistent answers regardless of version, dataset size, or performance demands.

Best Excel Approach

The single most reliable technique is to subtract the weekday position of your date from the date itself and add one day. Using the optional return-type argument in WEEKDAY lets you control which day is treated as the first day of the week.

Recommended formula (assume the original date is in cell [A2]):

=A2 - WEEKDAY(A2,1) + 1

Why this works

  1. WEEKDAY(A2,1) returns 1 for Sunday, 2 for Monday, … 7 for Saturday.
  2. Subtracting that integer from the original date pushes the date backward to the Saturday before the prior week.
  3. Adding 1 nudges the result from Saturday to Sunday, exactly one day after.
  4. When the source date is already a Sunday, WEEKDAY returns 1. The subtraction and the +1 cancel out, so the formula returns the same date—still a valid “previous Sunday.”

When to use

  • Any time you want “last Sunday, including today if today is Sunday.”
  • Works in every Excel version from 2003 forward.
  • Requires no external add-ins or dynamic arrays.

Alternative for “strictly earlier Sunday” (do not return the same day if the date is already Sunday):

=IF(WEEKDAY(A2,1)=1, A2-7, A2 - WEEKDAY(A2,1) + 1)

Dynamic-array version using LET for clarity:

=LET(
  wd, WEEKDAY(A2,1),
  A2 - wd + 1 - (wd=1)*7
)

Parameters and Inputs

  • Required input: a valid Excel date in any format (serial number 1 January 1900 or later on Windows; 1 January 1904 or later on Mac).
  • Data type: numeric. If the cell displays “11-Jun-2024”, the underlying value is 45213.
  • Optional return-type: the second argument of WEEKDAY. Using 1 means “Sunday=1”. Using 2 means “Monday=1”. The formulas above rely on return-type 1.
  • Validation: ensure the cell truly contains a date, not text. Compare =ISNUMBER(A2); TRUE confirms a numeric date.
  • Edge cases:
    – Empty cell returns a zero date (0-Jan-1900). Wrap the formula in IF(A2="","",formula) to suppress.
    – Non-date numbers (invoice IDs, account codes) will shift by unexpected weekday amounts.
  • Preparation: no sorting or formatting prerequisites, but apply a Date number format to the result cell so Excel displays a readable date instead of a number.

Step-by-Step Examples

Example 1: Basic Scenario

Imagine a personal budget sheet where each expense entry in column [A] holds the transaction date. You want a helper column that tags every entry with the Sunday that starts its budget week.

Sample data

[A1]  Header: Transaction Date
[A2]  09-Jun-2024
[A3]  12-Jun-2024
[A4]  15-Jun-2024

Steps

  1. In [B1], type “Previous Sunday”.
  2. In [B2], enter the recommended formula:
=A2 - WEEKDAY(A2,1) + 1
  1. Press Enter. Excel shows 09-Jun-2024.
  2. Drag the fill handle down through [B4]. Row by row you get:
  • 09-Jun-2024 → 09-Jun-2024 (already Sunday)
  • 12-Jun-2024 → 09-Jun-2024
  • 15-Jun-2024 → 09-Jun-2024
  1. Right-align or center the helper column for readability.

Why it works
WEEKDAY returns 4 for Wednesday (12-Jun-2024). Subtracting 4 moves the date back to Saturday 08-Jun-2024; adding 1 advances to Sunday 09-Jun-2024.

Variations

  • Need the week-ending Saturday instead? Drop the “+1” at the end.
  • Want blank output for blank input? Wrap in IF as described in the Parameters section.

Troubleshooting
If you see a number like 45220 instead of a date, apply a Date format: Home ➜ Number ➜ Short Date.

Example 2: Real-World Application

Scenario: A retail chain summarises point-of-sale data in a table called “Sales”. Column [B] holds sale dates. Regional managers receive weekly sales flash reports every Monday morning, covering the preceding Sunday-through-Saturday period. The reporting macro pivots on a “WeekStart” column that must equal the previous Sunday.

Data setup
Worksheet “SalesRaw”

  • [A] Store ID
  • [B] Sale Date
  • [C] Net Amount

You want to add [D] WeekStart.

Process

  1. Insert new column [D] and label “WeekStart”.
  2. Because the dataset contains 40,000 rows, typing formulas cell-by-cell is impractical. Instead select the entire [D2:D40001] range in one go.
  3. Type:
=B2 - WEEKDAY(B2,1) + 1
  1. Instead of pressing Enter, press Control + Enter to commit the formula to all highlighted cells at once.
  2. Create a named range “WeekStart” pointing to column [D].
  3. Build a PivotTable on a new sheet, adding WeekStart to Rows and Net Amount to Values (Sum).
  4. Optionally group WeekStart by weeks inside the PivotTable, though Excel will often auto-group because all dates in a bucket are identical Sundays.

Business impact
Because every transaction now ties to the correct week boundary, regional totals align perfectly with finance’s official weekly ledger. When a holiday weekend causes volume spikes, managers can quickly drill down into that Sunday start date instead of manually chasing calendar offsets.

Performance considerations
On 40,000 rows, the WEEKDAY math is instantaneous. If your sheet recalculates tens of thousands of VLOOKUPs, consider converting the data range to an Excel Table (Ctrl + T). Structured references automatically propagate the WeekStart formula to new rows without manual fills, making recurring data imports seamless.

Example 3: Advanced Technique

You run an international SaaS business. Financial compliance rules force you to recognise revenue based on the customer’s regional week definition. The US team uses Sunday start, but the French team uses Monday start. You need a single dynamic formula that returns the previous starting weekday based on a region code.

Sample data

  • [A] Invoice Date
  • [B] Region (“US” or “FR”)
  • [C] WeekStart (target column)

Dynamic array with CHOOSECOLS and LAMBDA (Microsoft 365 or Excel 2021):

=LET(
  dt, A2,
  reg, B2,
  type, IF(reg="US",1,2),           /* Sun=1, Mon=2 */
  adj, IF(reg="US",1,0),            /* add 1 day only for US */
  dt - WEEKDAY(dt,type) + adj - (type=1)*(WEEKDAY(dt,type)=1)*7
)

Explanation

  1. We set type to 1 when region is US (so Sunday=1) and 2 when region is FR (Monday=1).
  2. adj becomes 1 for US, 0 for FR because French weeks already start Monday, so we do not need the +1 nudge.
  3. The final corrective term -(type=1)*(WEEKDAY(dt,type)=1)*7 subtracts 7 days when the date is already Sunday and we need a strictly earlier week. Because (type=1) is TRUE for US, FALSE for FR, the subtraction activates only for the US strict-previous condition.
  4. All logic lives in a single LET, improving auditability and recalculation speed versus nested IFs on 50,000 rows.

Performance optimisation

  • Volatile functions: NONE. The formula recalculates only when its precedents change.
  • Memory: a LET wrapper stores intermediates, avoiding redundant WEEKDAY calls.
  • Maintenance: convert the formula into a reusable named LAMBDA “PrevWeekStart” so power users can write =PrevWeekStart(A2,B2) with zero complexity.

Error handling
Wrap the outer LET in IFERROR to catch non-numeric dates:

=IFERROR(PrevWeekStart(A2,B2),"Invalid date")

Tips and Best Practices

  1. Use absolute references in dashboards. For instance, =$A$2 - WEEKDAY($A$2,1) + 1 prevents surprises when the formula is copied across columns.
  2. Store dates in their own hidden helper columns rather than embedding long formulas inside slicer fields. This keeps models readable and easier to debug.
  3. When building Power Query date dimensions, compute “Previous Sunday” once during the query step instead of in downstream worksheets; this offloads calculation to the mash-up engine.
  4. Prefer LET for complex logic—it names parts, reduces redundant calculations, and speeds recalc.
  5. Document assumptions with comments. A small note “WEEKDAY type=1 so Sunday=1” avoids future confusion for colleagues in regions where weeks traditionally start Monday.
  6. Format helper dates as “ddd dd-mmm” (e.g., Sun 09-Jun) in reports; quick visual confirmation prevents off-by-one errors.

Common Mistakes to Avoid

  1. Wrong return-type in WEEKDAY
    Many examples search the web and copy WEEKDAY(date,2). Using 2 (Monday=1) without adjusting the arithmetic shifts every week boundary by one day. Fix by changing the second argument to 1 or adjusting the offset logic.
  2. Treating text as dates
    Cells that “look like” 11/06/24 but are formatted as Text produce wrong results or #####. Verify with ISNUMBER before applying the formula; convert with DATEVALUE if necessary.
  3. Forgetting the +1 adjustment
    Omitting +1 in the formula returns the preceding Saturday, not Sunday. Look for off-by-one anomalies in summarised totals.
  4. Accidentally including absolute references during fill
    If you lock the row reference (e.g., $A$2), every copied formula points to the same original date, producing identical Sundays. Remove the dollar signs or use mixed references.
  5. Ignoring daylight-saving crossover dates
    Although Excel dates are time-zone agnostic, mixing date-time values with explicit times (for example, 00:30 Sunday) can appear to shift Sunday to Monday in charts. Strip times with INT(date) before applying weekday math.

Alternative Methods

MethodCore FormulaProsConsVersion Support
Classic WEEKDAYdate - WEEKDAY(date,1) + 1Simple, universal, non-volatileNeeds extra IF for strict earlier SundayAll versions
MOD Offsetdate - MOD(date+1,7)Compact, no WEEKDAYHarder to read, less intuitiveAll versions
CHOOSE with MATCHdate - MATCH(WEEKDAY(date),[1,2,3,4,5,6,7],0) + 1Can customise alternate week startsVerbose, rarely necessary2007+
Power QueryDate.From(Date.AddDays([Date], -Date.DayOfWeek([Date], Day.Sunday)))Calculated once at ETL, no worksheet overheadRequires Data ➜ Get & Transform knowledge2016/365
VBA UDFFunction PrevSunday(d As Date) ...Encapsulates logic, easy reuseMacros disabled on some systemsAll desktop versions

When to choose

  • The classic WEEKDAY formula remains the go-to for on-sheet calculations.
  • Use Power Query if you are loading millions of rows into the Data Model—no recalc burden on the grid.
  • A VBA UDF is handy in legacy workbooks that already rely on macros but introduces security prompts.
  • MOD offset is popular among engineers comfortable with modular arithmetic; avoid in cross-team models where clarity outweighs brevity.

FAQ

When should I use this approach?

Use it whenever you need a deterministic anchor to the start of a calendar week, especially for reporting schedules, payroll cycles, or KPI dashboards that refresh continuously.

Can this work across multiple sheets?

Absolutely. Reference a date on Sheet1 from Sheet2 with =Sheet1!A2 - WEEKDAY(Sheet1!A2,1) + 1. For dozens of tabs, consider storing the formula in a named function so maintenance happens in one place.

What are the limitations?

The formula assumes the Gregorian calendar and does not account for historical calendar reforms before 1900. Also, it returns a Sunday regardless of regional weekend definitions—customise WEEKDAY’s return-type for cultures where weeks start differently.

How do I handle errors?

Wrap the logic in IFERROR:

=IFERROR(A2 - WEEKDAY(A2,1) + 1,"Invalid date")

You can also use conditional formatting to highlight cells where ISNUMBER returns FALSE.

Does this work in older Excel versions?

Yes. Excel 97 through Excel 2024 all support WEEKDAY with return-type 1. LET and dynamic arrays, however, require Microsoft 365 or Excel 2021.

What about performance with large datasets?

On one million rows, a simple arithmetic formula calculates almost instantly, but volatile functions like TODAY can trigger frequent recalc. If performance lags, move the computation to Power Query or Power Pivot, where columnar storage handles dates efficiently.

Conclusion

Mastering “previous Sunday” formulas unlocks a cornerstone of date analytics. Whether you build weekly dashboards, automate payroll, or prepare fiscal forecasts, reliably anchoring data to consistent week starts keeps numbers trustworthy and stakeholders happy. By learning both the classic WEEKDAY technique and its advanced variants, you gain flexibility across Excel versions and business scenarios. Keep experimenting—next up, try adapting the pattern for “previous Friday” or “next business day” to expand your date-management toolkit and elevate your overall Excel proficiency.

We use tracking cookies to understand how you use the product and help us improve it. Please accept cookies to help us improve.