You are viewing limited content. For full access, please sign in.

Question

Question

populate table in forms

asked on December 6, 2021

I'm working on a time sheets form process, and was wondering if it's possible to auto-populate the hours in the day as a default setting? It's for a two week period and we would always want weekends left blank. something like below: 

 

0 0

Answer

SELECTED ANSWER
replied on December 7, 2021

Yes, almost the exact same formula:

=IF(WEEKDAY(INDEX(Table.Date, ROW()), 2)<5, .5, "")

The 2 in the Weekday function starts the count on Monday=1. Then the IF statement checks to see if the value returned from weekday is less than 5 (first four days of the week Monday-Thursday) and if it is, inserts .5, otherwise, input the empty string "". 

0 0

Replies

replied on December 6, 2021 Show version history

Hi Catherine,

You can use following calculation formula in hour field

=IF(WEEKDAY(INDEX(Table.Date, ROW()), 2)<6, 7, "")

which firstly calculate the day of the week for date in same row (starting Monday), then populate the hour field based on the result.

0 0
replied on December 7, 2021

Thanks a bunch! the other column i want to calculate is for flex time, it's just 0.5 each week day except fridays, is this possible to calculate with a similar formula? Mon-Thurs would need the 0.5 in another column

0 0
SELECTED ANSWER
replied on December 7, 2021

Yes, almost the exact same formula:

=IF(WEEKDAY(INDEX(Table.Date, ROW()), 2)<5, .5, "")

The 2 in the Weekday function starts the count on Monday=1. Then the IF statement checks to see if the value returned from weekday is less than 5 (first four days of the week Monday-Thursday) and if it is, inserts .5, otherwise, input the empty string "". 

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.