Help

Upcoming database upgrades. to improve our reliability at 03:30 UTC on Feb. 25 / 7:30pm PT on Feb. 24. Some users may briefly experience slow load times or error messages. Learn more here

Divide week number

Topic Labels: Formulas
365 2
cancel
Showing results for 
Search instead for 
Did you mean: 

Hi, I would like to divide my week number field by 2 in order to group time entry by pay period. Our pay period is two weeks starting on sundays.

Here is the formula I use to get the week number: DATETIME_FORMAT(Date,‘w’)
And here is the formula I use in the pay period field: {# semaine}/2

I get #ERROR! in all the cell of the pay period field.

Capture d’écran de 2020-11-30 08-32-57

2 Replies 2

Precisely. :winking_face:

This is the expected behaviour when you try to divide a string. You either need to use the WEEKNUMBER() function to derive the weeks as number values, or you need to convert # semaine into a number before attempting to divide it.

Thank you so much.

I used the WEEKNUMBER() function and I was then able to divide it by 2.