Skip to content
xlsoffice. All Rights Reserved
  • Home
  • Excel For Beginners
  • Excel Intermediate
  • Advanced Excel For Experts

Lookup and Reference Examples

  • VLOOKUP function: Description, Usage, Syntax, Examples and Explanation
  • CHOOSE function: Description, Usage, Syntax, Examples and Explanation
  • How to reference named range different sheet in Excel
  • How to use Excel MMULT Function
  • Perform case-sensitive Lookup in Excel

Data Analysis Examples

  • Get column name from index in Excel Table
  • Use Data Form to input, edit and delete records in Excel
  • Data Series in Excel
  • How to create Checklist in Excel
  • How to create a Histogram in Excel

Data Validation Examples

  • Excel Data validation no punctuation
  • How To Create Drop-down List in Excel
  • Excel Data validation whole percentage only
  • Excel Data validation unique values only
  • Excel Data validation don’t exceed total

Roll back weekday to Friday base on a particular date in Excel

by

Case study:

If Monday, roll back to Friday

To check the weekday of a date, and roll back to Friday when the date is a Monday, you can use the IF and WEEKDAY functions.

Formula

=IF(WEEKDAY(date)=2,date-3,date)
If-Monday-roll-back-to-Friday Roll back weekday to Friday base on a particular date in Excel

Explanation

In the example shown, the formula in C5 is

=IF(WEEKDAY(B5)=2,B5-3,B5)

How this formula works

The WEEKDAY function returns a number, 1-7, that corresponds to particular days of the week. By default, WEEKDAY assumes a Sunday-based week, and assigns 1 to Sunday, 2 to Monday, and so on, with 7 assigned to Saturday.

Worked Example:   If cell contains in Excel

In this case, we only want to take action if the date in question is Monday. To test, we use this expression inside the IF function:

WEEKDAY(B5)=2

If the logical expression returns TRUE, we know the date is a Monday, so we subtract 3 to “roll back” to Friday. If the expression returns FALSE, we simply return the original date.

Worked Example:   How to test for all values in a range are at least in Excel

Post navigation

Previous Post:

How to join date and text together in Excel

Next Post:

How to get year from date in Excel

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Learn Basic Excel

Ribbon
Workbook
Worksheets
Format Cells
Find & Select
Sort & Filter
Templates
Print
Share
Protect
Keyboard Shortcuts

Categories

  • Charts
  • Data Analysis
  • Data Validation
  • Excel Functions
    • Cube Functions
    • Database Functions
    • Date and Time Functions
    • Engineering Functions
    • Financial Functions
    • Information Functions
    • Logical Functions
    • Lookup and Reference Functions
    • Math and Trig Functions
    • Statistical Functions
    • Text Functions
    • Web Functions
  • Excel VBA
  • Excel Video Tutorials
  • Formatting
  • Grouping
  • Others
  • DOLLAR function: Description, Usage, Syntax, Examples and Explanation
  • Convert text to numbers using VALUE function in Excel
  • How to get first word in Excel
  • Split dimensions into three parts in Excel
  • How to remove trailing slash from url in Excel
  • Calculate retirement date in Excel
  • Add workdays to date custom weekends in Excel
  • Roll back weekday to Friday base on a particular date in Excel
  • Get first day of previous month in Excel
  • Sum through n months in Excel
  • CUMIPMT function: Description, Usage, Syntax, Examples and Explanation
  • PV function: Description, Usage, Syntax, Examples and Explanation
  • SYD function: Description, Usage, Syntax, Examples and Explanation
  • DISC function: Description, Usage, Syntax, Examples and Explanation
  • How to calculate annual compound interest schedule in Excel
© 2022 xlsoffice . All Right Reserved. | Teal Smiles