LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Formula to return Friday's date: m/d/yyyy

I'm trying to write a formula to return this Friday's date (Format m/d/yyyy)
If it's a Saturday, I want next weeks Friday to be displayed

The following works, but takes 7 cells (each formula is in a different cell)
I would like to combine the following into one formula

=IF(WEEKDAY(NOW())=1,TODAY()+5,""
=IF(WEEKDAY(NOW())=2,TODAY()+4,""
=IF(WEEKDAY(NOW())=3,TODAY()+3,""
=IF(WEEKDAY(NOW())=4,TODAY()+2,""
=IF(WEEKDAY(NOW())=5,TODAY()+1,""
=IF(WEEKDAY(NOW())=6,TODAY()+0,""
=IF(WEEKDAY(NOW())=7,TODAY()+6,""

Value returned: 4/30/200

If I join each line together with an "&" the date is retuned in decimal value, not m/d/yyyy
The "number format" of the cell is Category: Date | Type: m/dd/yy
(The following is all on one line in my sheet, I broke it up here to make it easier to see

=IF(WEEKDAY(NOW())=1,TODAY()+5,"")
IF(WEEKDAY(NOW())=2,TODAY()+4,"")
IF(WEEKDAY(NOW())=3,TODAY()+3,"")
IF(WEEKDAY(NOW())=4,TODAY()+2,"")
IF(WEEKDAY(NOW())=5,TODAY()+1,"")
IF(WEEKDAY(NOW())=6,TODAY()+0,"")
IF(WEEKDAY(NOW())=7,TODAY()+6,""

Value returned: 3810

Maybe there is a better way to write this
Any ideas

Thanks
Austin M. Horst
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
change date format from dd/mm/yyyy to mm/yyyy flow23 Excel Discussion (Misc queries) 3 April 4th 23 11:26 AM
want formula bar date to be dd/mm/yyyy instead of mm/dd/yyyy.How? magna Excel Discussion (Misc queries) 1 January 1st 08 04:23 AM
how do I change date from mm/dd/yyyy to dd:mm:yyyy format in Excel Jack Wilson New Users to Excel 4 July 18th 06 01:57 PM
List First Friday's Date of the year seanrigby Excel Discussion (Misc queries) 2 May 8th 06 07:33 PM
Help: Can I change the date formula from mm/dd/yyyy to "mmm-yy" et wintersunshine Excel Discussion (Misc queries) 7 July 5th 05 09:44 PM


All times are GMT +1. The time now is 11:06 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"