0

I have a calendar excel sheet that has week number and month numbers, but it also has ID fields for week and month. So I have week 1 which has 7 days in it with each date having a week ID of 40. If I try the auto fill to drag down it ends up going 40.1, 40.2 or some things similar. Don't use excel often. Is it possible to get it to just repeat the ID for the Week? (for example every 7 days a new id is generated?)

Thanks

4

1 回答 1

2

获得重复值x次,然后将值增加 1 并重复x次的好技巧,......是使用行号的四舍五入除法:

=INT((ROW() - row_offset) / nr_of_repeats) + initial_value

例如以下公式的值:

=INT((ROW() - 2) / 7) + 40

A1  Header
A2  40
A3  40
A4  40
A5  40
A6  40
A7  40
A8  40
A9  41
A10 41
...

ROW酌情用COLUMNDay_ID替换或相对引用单元格。

在计算出正确的数字后,用(粘贴特殊)值替换公式可能是个好主意。

于 2013-07-01T16:17:21.630 回答