Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Flintstone
 
Posts: n/a
Default Skip a day of the week


Hi Darbar:

This is the best I could come up with; I hope its good enough.

=IF(A2+WEEKDAY(A1,1)=5,A2+A1+1,A2+A1)

Or

=IF(A2+WEEKDAY(A1)=1,A1+A2,IF(A2+WEEKDAY(A1)=2,A1+ A2,IF(A2+WEEKDAY(A1)=3,A1+A2,IF(A2+WEEKDAY(A1)=4,A 1+A2,IF(A2+WEEKDAY(A1)=5,A1+A2+1,IF(A2+WEEKDAY(A1) =6,A1+A2,IF(A2+WEEKDAY(A1)=12,A1+A2,"")))))))

Place either, or in C1.

The formulas work like you requested, "skipping over Thursday".

Formulas only work for the first Thursday, that means A2 should not be
a number greater than 6.

Problem is you can't remove Thursday's from the calendar, and the date
functions won’t allow you to ignore them either. Or more to the fact is
that I just don't have enough know how to get around it.

Matt


--
Flintstone
------------------------------------------------------------------------
Flintstone's Profile: http://www.excelforum.com/member.php...o&userid=15310
View this thread: http://www.excelforum.com/showthread...hreadid=373356

  #2   Report Post  
mangesh_yadav
 
Posts: n/a
Default


Use the following function. Enter the following code in a standard
module:


Code:
--------------------
Function myWorkDay(myDate As Date, AddDays, LeaveDay)

If AddDays = 0 Then
myWorkDay = myDate
Exit Function
End If

For j = 1 To 7
If Choose(j, "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday") = LeaveDay Then
LD = j
End If
Next j

i = 1
Do While i <= AddDays
myWorkDay = myDate + i
If WorksheetFunction.Weekday(myWorkDay) = LD Then
AddDays = AddDays + 1
End If
i = i + 1
Loop

End Function

--------------------


Usage:
Enter in cell C1
=myWorkDay(A1,A2,"Thursday")


Mangesh


--
mangesh_yadav
------------------------------------------------------------------------
mangesh_yadav's Profile: http://www.excelforum.com/member.php...o&userid=10470
View this thread: http://www.excelforum.com/showthread...hreadid=373356

  #3   Report Post  
Darbar
 
Posts: n/a
Default


Thank you very much Mangesh !!!!

I got the perfect result. Thanks a lot.


DARBAR


--
Darbar
------------------------------------------------------------------------
Darbar's Profile: http://www.excelforum.com/member.php...o&userid=23665
View this thread: http://www.excelforum.com/showthread...hreadid=373356

  #4   Report Post  
mangesh_yadav
 
Posts: n/a
Default


Appreciate the feedback. Thanks

Mangesh


--
mangesh_yadav
------------------------------------------------------------------------
mangesh_yadav's Profile: http://www.excelforum.com/member.php...o&userid=10470
View this thread: http://www.excelforum.com/showthread...hreadid=373356

  #5   Report Post  
mangesh_yadav
 
Posts: n/a
Default


Found another solution through this thread:
http://excelforum.com/showthread.php...d=1#post992503

=$A$1+IF(B1=0,0,SIGN(B1)*SMALL(IF((WEEKDAY($A$1+SI GN(B1)*(ROW(INDIRECT("1:"&ABS(B1)*10))),2)<4)*ISN A(MATCH($A$1+SIGN(B1)*(ROW(INDIRECT("1:"&ABS(B1)*1 0))),0,0)),ROW(INDIRECT("1:"&ABS(B1)*10))),ABS(B1) ))

confirm with control shift enter

A1 is the date, B1 is the number of days to add.



Mangesh


--
mangesh_yadav
------------------------------------------------------------------------
mangesh_yadav's Profile: http://www.excelforum.com/member.php...o&userid=10470
View this thread: http://www.excelforum.com/showthread...hreadid=373356

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
user defined function Brian Rogge Excel Worksheet Functions 5 May 23rd 05 06:21 PM
how to get 52 week hi/lo data for UK stocks Andy Jones Excel Worksheet Functions 1 February 26th 05 10:43 PM
Line or bar graphs for tracking stocks profit and loss. Mocity Charts and Charting in Excel 1 January 21st 05 01:21 AM
I need week number in excell from a date, first week must be mini. jPeich Excel Discussion (Misc queries) 4 January 5th 05 01:21 AM
first week of year - according to european standard soren Excel Worksheet Functions 3 November 2nd 04 07:21 PM


All times are GMT +1. The time now is 05:21 PM.

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

About Us

"It's about Microsoft Excel"