I have a column meant to contain the pertinent workweek based on paydate. In this case, the workweek is 3 weeks sooner than the paydate’s week.

I have appended the 4 digit year in front of the workweek since the column data will hold more than one year’s worth of workweeks (201852, 201901). I tried to create a formula that accounts for a workweek that occurs in late 2018 but is paid 3 weeks later in early 2019.

Column H contains the paydates.

Calc is giving me an Err: 504

```
=IF(H3="","",IF((SUM(WEEKNUM((H3),21)-3))>9,VALUE(YEAR(H3))&SUM(WEEKNUM((H3),21)-3)),IF((SUM(WEEKNUM((H3),21)-3))>3,VALUE(YEAR(H3)&0&SUM(WEEKNUM((H3),21)-3)),VALUE(SUM(YEAR(H3)-1)&0&IF(H3=3,52,IF(H3=2,51,50)))))
```

Err 504 Parameter list error: Function

parameter is not valid, for example,

text instead of a number, or a domain

reference instead of cell reference.

I am not finding my mistake causing the error on my own. I’m unsure what I did wrong and need some help fixing my formula. Thanks.