date formatting

Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

Forum home » Delegate support and help forum » Microsoft Excel Training and help » Date formatting

Date formatting

resolvedResolved · Low Priority · Version 2003

Ross has attended:
Excel Intermediate course

Date formatting

How to creat a formula for yesterdays date that is a day during the week i.e. If Monday then the date must be the Friday before. If tues then the date must be Monday.

Edited on Wed 17 Sep 2008, 15:02

RE: Date formatting

Hi Ross

Thank you for your question.
The answer requires the use of the IF function and Weekday function. Weekday function returns 1-7 when given a date. So given that Monday returns 2 you can use the following:

=IF(WEEKDAY(C4)=2,C4-3,C4-1)

This formula assumes that the date is in C4, and that the dates will only be Monday to Friday dates.

If you are looking at more complex functions then perhaps you should consider the Excel Advanced course.

Let me know if you need further help.

Laura GB

 

Training courses

 

Training information:

See also:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.


 

Excel tip:

Using the Quick Access Toolbar in Excel2010

The Quick Access Toolbar is included in virtually every Office product, including Outlook 2010, Word 2010, Excel 2010, and PowerPoint 2010.

You will find the Quick Access Toolbar in the top-left side of the window. To begin, click the Customize button (it's the little black arrow at the end of the toolbar).

Simply click the commands you want to include.

Virtually any command can be added to the Quick Access Toolbar. Click the More Commands option and a new window will open from where you can browse the commands including those not on the ribbon.

View all Excel hints and tips


Server loaded in 0.09 secs.