Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 947
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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
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
Formula to display next Friday from B1 works except on the Friday itself. StargateFan[_2_] Excel Discussion (Misc queries) 4 August 11th 11 09:20 AM
Finding the previous Saturday, then Friday date Bob Excel Worksheet Functions 3 April 9th 08 03:32 AM
Finding Friday in week number DavidS New Users to Excel 5 October 24th 06 10:04 AM
How can I get a row to display the date of the last friday, and every friday before that? [email protected] Excel Programming 1 April 10th 06 07:42 PM
Finding Friday Arlen Excel Discussion (Misc queries) 1 January 23rd 05 05:08 AM


All times are GMT +1. The time now is 09:21 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"