How to Move Excel Values Horizontally by a Dynamic Number of Weeks in WPS Spreadsheets
Question details
The user needs a timeline formula that shifts an input value horizontally by a dynamic number of weeks, so it appears the specified number of columns later based on an activity duration.

- Product
- WPS Spreadsheets
- Device & OS
- not provided
- Scenario
- Building a weekly timeline or schedule in which activity inputs must move across columns according to each activity's duration in weeks.
- Observed behavior
- The value remains in the original column instead of automatically appearing in the target column when the week duration changes.
Open your WPS Spreadsheets workbook and identify the input row, the first destination column, and the duration cells such as B12 or B13. Confirm the duration cells are filled before copying the formula across the timeline.
Use an OFFSET Formula to Shift Values by a Dynamic Number of Weeks
This solution applies when you want the timeline to update automatically whenever the activity duration in a master cell changes.
The OFFSET function is the key because its column offset can be controlled by a cell. When the duration changes from 3 to 5, the formula checks five columns to the left and updates the 1/0 timeline without editing the formula.
Open the timeline worksheet in WPS Spreadsheets and click the cell where the shifted result should first appear. For an input in E2 with a duration of 3 weeks, this is H2.
Type =IF(OFFSET(H2,0,-$B$12)=1,1,0) in the formula bar. Replace H2 with the current timeline cell and $B$12 with the cell that holds that activity's week duration.
Press Enter to confirm, then drag the fill handle to the right across the timeline row. The formula updates the relative H2 reference while keeping the duration cell $B$12 locked.
Use the appropriate master-data cell, such as B12 or B13, for each activity. Change the duration value and the shifted 1/0 values move automatically along the timeline.

Build a Dynamic Weekly Timeline with WPS Spreadsheets
Use the OFFSET formula in WPS Spreadsheets to move Excel timeline values to the right by a dynamic number of weeks. The formula references a duration cell, so the timeline updates automatically when the week count changes.
- 1. Download and install WPS Office: Go to the official WPS website, download WPS Office, and install it on your device.
- 2. Open your Excel timeline workbook: Launch WPS Spreadsheets and open the workbook that contains the timeline inputs and duration cells.
- 3. Enter the OFFSET formula: Click the first destination cell, type =IF(OFFSET(H2,0,-$B$12)=1,1,0) in the formula bar, replace H2 with the current timeline cell, and replace $B$12 with your duration cell.
- 4. Fill the formula across the timeline: Press Enter, then drag the fill handle across the timeline row to apply the dynamic week offset to all relevant columns.
- 5. Update duration cells to see automatic shifts: Change the value in B12 or B13 for each activity and confirm the 1/0 timeline jumps to the correct week column automatically.

Frequently Asked Questions
Why does the OFFSET formula return #REF! when the duration is larger than the number of columns to the left?
The formula is trying to reference a column before column A. Move the formula further to the right, or wrap it with a column guard such as =IF(COLUMN()-$B$12<1,0,IF(OFFSET(H2,0,-$B$12)=1,1,0)).
Can I use a cell reference for the number of weeks instead of typing a fixed number?
Yes. Use an absolute reference such as $B$12 as the column offset argument in OFFSET. Changing B12 or B13 then moves the lookup automatically for that activity.
How do I copy the formula without changing the duration cell reference?
Lock the duration cell with dollar signs, for example $B$12, then drag the fill handle across the timeline row. The duration reference stays fixed while the target cell reference updates relatively.
Does this OFFSET timeline approach work in WPS Spreadsheets with Excel files?
Yes. WPS Spreadsheets supports the OFFSET function and opens and saves .xlsx workbooks, so the formula behaves the same as in Microsoft Excel.




