# Microsoft Office Application Help - Excel Help forum > Excel Formulas & Functions >  >  Returning the date for last Friday

## MasterMonk

Does anybody know how to write an excel workbook function that will return last friday's date?

For example: 
If Today is 2/12/2008, it will return 2/8/2008 as the date

Thanks in advance!

----------


## NBVC

Try:

=TODAY()-WEEKDAY(TODAY())-1

----------


## MasterMonk

That works great!  Thanks alot!

----------


## ExcelKnut

Good morning NBVC or MasterMonk,

This formula is exactly what I needed.  And although it's fairly straight forward, I don't quite understand how it works.  Assuming today is Friday, 3/28/14, I believe WEEKDAY(TODAY())-1 returns 5 [WEEKDAY(TODAY())=6 then subtract 1 and you get 5].   Then when subtracting 5 from TODAY() I get Sunday, 3/23/14 not Friday, 3/21/14?   Please explain.

Your time is greatly appreciated!!!

----------


## PGBrown

I just found this thread and I hope you figured out how the formula works ExcelKnut, but if not, I can help. 

"I believe WEEKDAY(TODAY())-1 returns 5 [WEEKDAY(TODAY())=6 then subtract 1 and you get 5"   That's not quite right. 

TODAY()-WEEKDAY(TODAY())-1

You're taking the value of Today() and subtracting Weekday(Today()) and then also subtracting 1. So you wouldn't be subtracting 5, you would be subtracting 6 and then subtracting 1, or more simply, subtracting 7 not 5. Hope this helps! :Smilie:

----------


## Jonmo1

It's the order of calculations.
They are calculated left to right.

It's not Today - (weekday - 1)
It's actually (Today - weekday) - 1

----------


## ExcelKnut

Jonmo1,

I know it's been a few months but thanks for explaining that.  It was very helpful.

EK

----------


## nickpavlov

Hello,

I needed something similar to this and found this thread. 

Can this formula be adjusted to include the current or last Friday? Say if today is Friday, like it is  :Smilie:  I would want today displayed.

thanks for any help 

Nick

----------


## PGBrown

Wrap it in an IF() statement that checks if today is Friday:
=IF(WEEKDAY(TODAY())=6,TODAY(),TODAY()-WEEKDAY(TODAY())-1)

----------


## AliGW

*Administrative Note:*

Welcome to the forum.  :Smilie: 

We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.

Please see Forum Rule #4 about hijacking and start a new thread for your query.

If you are not familiar with how to start a new thread see the FAQ: How to start a new thread

----------

