Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
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. |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
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. |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
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. |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Formula to display next Friday from B1 works except on the Friday itself. | Excel Discussion (Misc queries) | |||
Finding the previous Saturday, then Friday date | Excel Worksheet Functions | |||
Finding Friday in week number | New Users to Excel | |||
How can I get a row to display the date of the last friday, and every friday before that? | Excel Programming | |||
Finding Friday | Excel Discussion (Misc queries) |