here is a simpler formula. Base = week of calender year for oct. 1st. Target = week of year for the date that you want week of financial year.
week of financal year =
target - base OR target - base + 52.
i hope this is easier to understand.