View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.programming
Mary-Lou Mary-Lou is offline
external usenet poster
 
Posts: 9
Default Strange vlookup results

Thank you.

I tried this out, but whenever a resource start date (in Worksheet A)
matched exactly to the Week Start Date in Worksheet B, the value did not
round up and always remained 1 less than it should have been.

When testing out all 365 days of the year, I received 52 incorrect values.
For example, the first recource start date is Oct 22 and when compared
against the Start Week Date (also Oct 22), the value came back as zero...but
the next 6 values worked out fine, then the 7th would be incorrect, with the
next 6 values incorrect, etc.


" wrote:

I think "StartDate" means "FiscalYearStartDate", in which case the
formula barbetta suggested would calculate the week of the fiscal year
based on the fiscal year start date. It finds the number of days
between the fiscal year start date *you provide* and the date in column
B of worksheetA, then divides by 7 and rounds up to the nearest integer
to give you the correct week based on your fiscal year. Maybe I'm not
understanding this correctly, but using that formula is much simpler
than the VLOOKUP you're trying to do.

It appears the fiscal year start date is currently at WorksheetB!$A$2,
so

=IF($B2="","",ROUNDUP(($B2-WorksheetB!$A$2)/7,0))

should do it. Let me know if I misunderstand.