ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   WEEKNUM calculations for week stating with Tuesday (https://www.excelbanter.com/excel-worksheet-functions/190813-weeknum-calculations-week-stating-tuesday.html)

P C Verma

WEEKNUM calculations for week stating with Tuesday
 
While calculating WEEKNUM stating from Tuesday to Friday i am getting error
massage #NUM# but for week staring from Sunday and Monday it calculating
correctly. What could be the reason and how to work around it correctly.

Mike H

WEEKNUM calculations for week stating with Tuesday
 
Maybe

=IF(WEEKDAY(A1,2)1,WEEKNUM(A1,2)+1,WEEKNUM(A1,2))

Mike

"P C Verma" wrote:

While calculating WEEKNUM stating from Tuesday to Friday i am getting error
massage #NUM# but for week staring from Sunday and Monday it calculating
correctly. What could be the reason and how to work around it correctly.


Stefi

WEEKNUM calculations for week stating with Tuesday
 
There is no known place in the world where week starts with Tuesday-Friday,
therefore Excel doesn't have this feature. What do you want to do?

Regards,
Stefi

€˛P C Verma€¯ ezt Ć*rta:

While calculating WEEKNUM stating from Tuesday to Friday i am getting error
massage #NUM# but for week staring from Sunday and Monday it calculating
correctly. What could be the reason and how to work around it correctly.


David Biddulph[_2_]

WEEKNUM calculations for week stating with Tuesday
 
What is your formula? What values are in the cells leading into the
formula? What value did you get as a result? What value did you expect?
What formula is working correctly for what data?
--
David Biddulph

"P C Verma" <P C wrote in message
...
While calculating WEEKNUM stating from Tuesday to Friday i am getting
error
massage #NUM# but for week staring from Sunday and Monday it calculating
correctly. What could be the reason and how to work around it correctly.




Ron Rosenfeld

WEEKNUM calculations for week stating with Tuesday
 
On Wed, 11 Jun 2008 02:14:00 -0700, P C Verma <P C
wrote:

While calculating WEEKNUM stating from Tuesday to Friday i am getting error
massage #NUM# but for week staring from Sunday and Monday it calculating
correctly. What could be the reason and how to work around it correctly.


IF you are doing what I think you are, you are using an unacceptable argument
for the return_type argument in the WEEKNUM function. Although not entirely
clear in the HELP documentation, the ONLY acceptable arguments are 1 or 2 (or
left blank in which case '1' is understood).

What are you trying to do?
--ron

Rick Rothstein \(MVP - VB\)[_658_]

WEEKNUM calculations for week stating with Tuesday
 
I'm guessing you haven't heard of the "4-day work week" that many companies
have already adopted? One of the methods of implementing this schedule is to
give the workers Monday off in conjunction with the normal weekend.

Rick


"Stefi" wrote in message
...
There is no known place in the world where week starts with
Tuesday-Friday,
therefore Excel doesn't have this feature. What do you want to do?

Regards,
Stefi

€˛P C Verma€¯ ezt Ć*rta:

While calculating WEEKNUM stating from Tuesday to Friday i am getting
error
massage #NUM# but for week staring from Sunday and Monday it calculating
correctly. What could be the reason and how to work around it correctly.



Rick Rothstein \(MVP - VB\)[_659_]

WEEKNUM calculations for week stating with Tuesday
 
If you don't mind using a User Defined Function (UDF), then here is a method
that creates the worksheet function you want. Keyin Alt+F11 to go to the VB
editor and click on Insert/Module on the menu bar there. Copy/Paste this
code into the code window that appeared when you did that...

Function WeekNumber(D As Date) As Long
If D = 0 Then
WeekNumber = 0
Else
WeekNumber = DatePart("ww", D, vbTuesday, vbFirstJan1)
End If
End Function

Now, back on your work sheet... assuming, say, C3 contains a date, put this
in any other cell...

=WeekNumber(C3)

and it will display the week number you want given the Tuesday start of week
(using the same start of year that the WEEKNUM function uses).

Rick


"P C Verma" <P C wrote in message
...
While calculating WEEKNUM stating from Tuesday to Friday i am getting
error
massage #NUM# but for week staring from Sunday and Monday it calculating
correctly. What could be the reason and how to work around it correctly.



Stefi

WEEKNUM calculations for week stating with Tuesday
 
You are right, but in this case Excel is behind the developments in the
world. Does Excel2007 have this feature?

Regards,
Stefi

€˛Rick Rothstein (MVP - VB)€¯ ezt Ć*rta:

I'm guessing you haven't heard of the "4-day work week" that many companies
have already adopted? One of the methods of implementing this schedule is to
give the workers Monday off in conjunction with the normal weekend.

Rick


"Stefi" wrote in message
...
There is no known place in the world where week starts with
Tuesday-Friday,
therefore Excel doesn't have this feature. What do you want to do?

Regards,
Stefi

€˛P C Verma€¯ ezt Ć*rta:

While calculating WEEKNUM stating from Tuesday to Friday i am getting
error
massage #NUM# but for week staring from Sunday and Monday it calculating
correctly. What could be the reason and how to work around it correctly.





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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com