View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Frank Kabel Frank Kabel is offline
external usenet poster
 
Posts: 3,885
Default WEEKNUM Question

Hi
you can't use text functions on a date value
try
=IF(RIGHT(TEXT(D9,"YYYY"),1)="5",WEEKNUM(D9,1)-1,WEEKNUM(D9,1))


--
Regards
Frank Kabel
Frankfurt, Germany

"RustyR" schrieb im Newsbeitrag
...
Hi,

In my company, 2004 has 53 weeks so Week 1 of 2005 is January 2nd.

I am trying to create a formula that checks the last number of the

year like
so (D( is a date in the form of 1/1/2005):
=IF((RIGHT(D9)=5),(WEEKNUM(D9,1)-1),WEEKNUM(D9,1))

But the problem is, RIGHT(D9) gives me a 0???

Any ideas??

Thank you in advance.

Rusty