formula for finding Friday
Looping through a series of cells with dates, need to compute from the
given date the date of the following Friday. If the given date *is* Friday, I need that date returned, not the date of the Friday of the following week. Thanks. |
formula for finding Friday
Try
=A1+CHOOSE(WEEKDAY(A1),5,4,3,2,1,0,6) where A1 is your starting date. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "EdStevens" wrote in message oups.com... Looping through a series of cells with dates, need to compute from the given date the date of the following Friday. If the given date *is* Friday, I need that date returned, not the date of the Friday of the following week. Thanks. |
formula for finding Friday
Well, Weekday(Date) will return an integer to represent the day of th week, so you can just use a 'Case' structure to vary the response base on the current day fo the week can't you (IF today is Monday, the return today + 5 etc...) If you need code, I can find some for you... Regards, Garet -- pianoma ----------------------------------------------------------------------- pianoman's Profile: http://www.excelforum.com/member.php...fo&userid=3371 View this thread: http://www.excelforum.com/showthread.php?threadid=55097 |
formula for finding Friday
you said looping so here is a looping macro
Sub iffriday() For Each c In Selection If Application.Weekday(c) = 6 Then MsgBox c.Address Next End Sub -- Don Guillett SalesAid Software "EdStevens" wrote in message oups.com... Looping through a series of cells with dates, need to compute from the given date the date of the following Friday. If the given date *is* Friday, I need that date returned, not the date of the Friday of the following week. Thanks. |
formula for finding Friday
Ignore mine! Chip know best! :) I think I'll impliment this in some of my own code.. -- pianoma ----------------------------------------------------------------------- pianoman's Profile: http://www.excelforum.com/member.php...fo&userid=3371 View this thread: http://www.excelforum.com/showthread.php?threadid=55097 |
formula for finding Friday
=A1+6-WEEKDAY(A1)
-- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "EdStevens" wrote in message oups.com... Looping through a series of cells with dates, need to compute from the given date the date of the following Friday. If the given date *is* Friday, I need that date returned, not the date of the Friday of the following week. Thanks. |
formula for finding Friday
Just another option:
=A1+MOD(138612,WEEKDAY(A1)+6) -- HTH. :) Dana DeLouis Windows XP, Office 2003 "EdStevens" wrote in message oups.com... Looping through a series of cells with dates, need to compute from the given date the date of the following Friday. If the given date *is* Friday, I need that date returned, not the date of the Friday of the following week. Thanks. |
formula for finding Friday
Chip Pearson wrote: Try =A1+CHOOSE(WEEKDAY(A1),5,4,3,2,1,0,6) where A1 is your starting date. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "EdStevens" wrote in message oups.com... Looping through a series of cells with dates, need to compute from the given date the date of the following Friday. If the given date *is* Friday, I need that date returned, not the date of the Friday of the following week. Thanks. Perfect. Thank you. |
All times are GMT +1. The time now is 05:10 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com