Managing tasks in Google Sheets works well until your active task list becomes crowded with finished work.
You complete a task, change its status to Done, and move on. Over time, dozens or hundreds of completed records accumulate alongside tasks that still need attention.
You can manually cut completed rows and paste them into another worksheet, but that approach takes time and creates opportunities for mistakes.
A better solution is to automatically move completed rows in Google Sheets using Google Apps Script.
With a small automation, a finished task can disappear from your Active Tasks tab and appear in a Completed Tasks archive, complete with a timestamp showing when it was archived.
In this tutorial, you’ll learn how to create that workflow with a free sample dataset and a reusable Apps Script.
Unlike basic row-moving examples, our implementation includes a preview mode, unique task IDs, duplicate checks, and safer handling of multiple edited rows.
We’ll also cover the most common reasons the automation stops working and explain when filtering completed tasks is safer than physically moving rows.
Can Google Sheets Automatically Move Completed Rows?
Yes. Google Sheets can move rows automatically with Google Apps Script.
The spreadsheet itself does not have a built-in setting that permanently moves a row to another tab whenever a specific dropdown value is selected.
However, an Apps Script onEdit(e) function can respond when a user edits a cell.
For example, imagine this task tracker:
| Task ID | Task | Owner | Status |
|---|---|---|---|
| TASK-1001 | Send welcome email | Alex | Not Started |
| TASK-1002 | Update checklist | Morgan | In Progress |
| TASK-1003 | Review sample invoice | Casey | Completed |
When the status of TASK-1003 changes to Completed, the script can copy its values into the Completed Tasks tab and remove its original row from Active Tasks.
The active sheet then contains only the unfinished tasks.
The archived copy retains the task ID, owner, status, and other values, plus an Archived At timestamp.
What Happens Behind the Scenes?
The automation follows this sequence:
- A user changes a status cell.
- Google Sheets invokes the
onEdit(e)function. - The script checks the worksheet name and edited column.
- It verifies whether the status is Done or Completed.
- It checks whether the task has a valid ID.
- It verifies that the ID is not already in the archive.
- It copies the task’s values to the archive.
- After the write succeeds, it deletes the original row.
Google’s official guide to Apps Script simple triggers explains how onEdit(e) responds to spreadsheet edits and the restrictions that apply.
Why Archive Completed Tasks Instead of Deleting Them?
Completed tasks may still contain useful information.
For example, you might need to review who handled a project, which assignments were finished, or how many tasks were completed during a reporting period.
Archiving can help you:
- Keep active task lists easier to read.
- Preserve historical task records.
- Review completed work by employee.
- Track the date when tasks were archived.
- Reduce manual copying between tabs.
- Separate current work from historical records.
A small business might use the same approach for project checklists, non-sensitive service requests, production tasks, or administrative work.
Archiving Is Not the Same as Backing Up
This is an important distinction.
Moving rows to a different tab in the same spreadsheet does not create an independent backup.
A user with sufficient access could still edit or delete the archived records.
For important business data, maintain separate backups and appropriate access controls.
Three Ways to Handle Completed Rows in Google Sheets
Before choosing an automation, consider the differences between hiding, displaying, and physically moving records.
| Method | Moves original data? | Best use |
|---|---|---|
| Filter view | No | Hiding completed tasks temporarily |
| FILTER formula | No | Displaying completed tasks in another tab |
| Apps Script row archiving | Yes | Maintaining a separate active list and archive |
Method 1: Filter Completed Tasks
You can filter the Status column to display only unfinished tasks.
This leaves all records in their original locations.
It is the safest option when you don’t need physical row movement.
Method 2: Use a FILTER Formula
If you want a separate view of completed tasks, you can use a formula.
For example, if Status is column E:
=FILTER('Active Tasks'!A2:F,'Active Tasks'!E2:E="Completed")
This displays matching rows from the source worksheet.
However, it does not move or delete the original records.
The displayed results also remain dependent on the source data.
Method 3: Use Apps Script
Apps Script can physically archive task records.
This is useful when your operational requirement is to remove completed rows from the active worksheet.
Because this method deletes the source row after copying its values, testing and backups matter.
The rest of this guide focuses on Apps Script.
Step 1: Create Your Google Sheets Task Tracker
Open Google Sheets and create a new spreadsheet.
Name it:
Automated Task Archive
Rename the first worksheet:
Active Tasks
In row 1, add these headings in exactly this order:
| Column | Heading |
|---|---|
| A | Task ID |
| B | Task |
| C | Owner |
| D | Due Date |
| E | Status |
| F | Notes |
These headings match the sample file and code in this tutorial.
Add Sample Tasks
Enter fictional records such as:
| Task ID | Task | Owner | Due Date | Status |
|---|---|---|---|---|
| TASK-1001 | Send welcome email | Alex | Oct 22, 2026 | Not Started |
| TASK-1002 | Update checklist | Morgan | Oct 23, 2026 | In Progress |
| TASK-1003 | Review sample invoice | Casey | Oct 20, 2026 | Completed |
| TASK-1004 | Prepare demo report | Jordan | Oct 24, 2026 | Open |
| TASK-1005 | Close sample ticket | Alex | Oct 20, 2026 | Done |
The examples use fictional information.
Why Task IDs Are Important
Every task should have a unique, stable identifier.
For example:
TASK-1003
If two records have the same task ID, the automation may not be able to distinguish an accidental duplicate from a legitimate task.
Our script preserves ambiguous source rows instead of deleting them.
For a broader task management workflow involving assignments and notifications, see our Google Sheets task tracker with email reminders guide.
Step 2: Create a Status Dropdown
Select the cells in the Status column, starting from E2.
Open:
Data → Data validation
Create a dropdown containing:
- Not Started
- In Progress
- Completed
- Done
- On Hold
Save the rule.
Now users can select a consistent task status rather than typing different variations.
Which Status Values Trigger Archiving?
The script in this tutorial recognizes:
Completed
and:
Done
Capitalization does not matter.
For example, completed and COMPLETED are also recognized.
Statuses such as In Progress and On Hold do not trigger archiving.
Can I Use Checkboxes?
Yes.
The script also recognizes a checked checkbox when the Status column returns the Boolean value TRUE.
For example, you can replace the Status dropdown with checkboxes if your workflow needs only completed and incomplete states.
However, avoid mixing checkbox and text status conventions unpredictably within the same production tracker.
Step 3: Prepare the Completed Tasks Archive
You may create a second worksheet manually and name it:
Completed Tasks
Alternatively, the script can create the archive worksheet automatically when it first moves a task.
The archive must use the same column structure as the Active Tasks worksheet, followed by one extra column:
Archived At
Archive Example
| Task ID | Task | Owner | Status | Archived At |
|---|---|---|---|---|
| TASK-1003 | Review sample invoice | Casey | Completed | Oct 20, 2026 |
| TASK-1005 | Close sample ticket | Alex | Done | Oct 20, 2026 |
This simplified table illustrates the final result.
The actual script preserves all six source columns and adds the archival timestamp as the seventh column.
Important Preparation Rule
If you create the archive manually, its header order must match the source sheet.
The script checks that structure before transferring data.
If the headers do not match, the script stops rather than placing values into the wrong columns.
Step 4: Download the Free Google Sheets Starter Kit
The free starter kit accompanying this tutorial contains three files:
Code.gs
The complete Google Apps Script for archiving completed task rows.
Active_Tasks_Sample.csv
A fictional sample task list that includes both completed and unfinished records.
README.md
Setup instructions, testing steps, and important safety limitations.
Download the Starter Kit
Download the Free Google Sheets Completed Rows Starter Kit (ZIP)
After obtaining the kit, extract the files, open the README, and follow the instructions below.
The automation starts in preview mode so you can inspect matching records before any source rows are deleted.
Step 5: Add the Google Apps Script Code
Open the task spreadsheet.
Choose:
Extensions → Apps Script
Google will open the Apps Script editor.
Replace the example placeholder code with the following script.
Complete Apps Script
/**
* IA Network: Google Sheets Completed Row Archiver
* https://ianetwork.site/
* Use only in a COPY of a test spreadsheet first.
* This moves VALUES (not formulas, formatting, or notes).
*/
const ARCHIVE_SETTINGS = {
sourceSheet: 'Active Tasks',
archiveSheet: 'Completed Tasks',
idHeader: 'Task ID',
statusHeader: 'Status',
previewOnly: true, // Set false ONLY after testing with sample data.
maxRowsPerRun: 50
};
// Automatically runs for direct user edits in the bound spreadsheet.
function onEdit(e) {
if (!e || !e.range) return;
const sheet = e.range.getSheet();
if (sheet.getName() !== ARCHIVE_SETTINGS.sourceSheet) return;
const headers = readHeaders_(sheet);
const statusIndex = headers.indexOf(ARCHIVE_SETTINGS.statusHeader);
if (statusIndex < 0) return;
const statusCol = statusIndex + 1;
if (e.range.getColumn() > statusCol ||
e.range.getLastColumn() < statusCol) return;
if (e.range.getNumRows() > 20) {
console.log('Large paste: use Task Archive > Archive completed rows.');
return;
}
const start = Math.max(2, e.range.getRow());
if (start > e.range.getLastRow()) return;
const result = archiveRows_(sheet.getParent(), start,
e.range.getLastRow(), ARCHIVE_SETTINGS.previewOnly);
console.log(JSON.stringify(result));
}
function onOpen() {
SpreadsheetApp.getUi()
.createMenu('Task Archive')
.addItem('Preview completed rows', 'previewArchive')
.addItem('Archive completed rows', 'archiveCompletedRows')
.addToUi();
}
function previewArchive() {
const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheetByName(ARCHIVE_SETTINGS.sourceSheet);
if (!sheet) throw new Error('Source sheet not found.');
const result = archiveRows_(ss, 2, sheet.getLastRow(), true);
SpreadsheetApp.getUi().alert(
'Preview: ' + result.candidates + ' completed row(s) found. ' +
'No rows moved. Skipped ' + result.skipped +
' row(s) because of missing or duplicate Task IDs.'
);
}
function archiveCompletedRows() {
const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheetByName(ARCHIVE_SETTINGS.sourceSheet);
if (!sheet) throw new Error('Source sheet not found.');
const result = archiveRows_(ss, 2, sheet.getLastRow(),
ARCHIVE_SETTINGS.previewOnly);
SpreadsheetApp.getUi().alert(
(ARCHIVE_SETTINGS.previewOnly ? 'PREVIEW ONLY. ' : '') +
'Completed matches: ' + result.candidates +
'. Moved: ' + result.moved + '. Skipped: ' + result.skipped +
'. Run limit: ' + ARCHIVE_SETTINGS.maxRowsPerRun + '.'
);
}
function archiveRows_(ss, firstRow, lastRow, previewOnly) {
const lock = LockService.getDocumentLock();
if (!lock) throw new Error('This script must be bound to a spreadsheet.');
lock.waitLock(10000);
try {
const source = ss.getSheetByName(ARCHIVE_SETTINGS.sourceSheet);
if (!source) throw new Error('Source sheet is missing.');
const headers = readHeaders_(source);
const idIndex = headers.indexOf(ARCHIVE_SETTINGS.idHeader);
const statusIndex = headers.indexOf(ARCHIVE_SETTINGS.statusHeader);
if (idIndex < 0 || statusIndex < 0)
throw new Error('Headers must include Task ID and Status.');
if (headers.filter(h => h === ARCHIVE_SETTINGS.idHeader).length !== 1 ||
headers.filter(h => h === ARCHIVE_SETTINGS.statusHeader).length !== 1)
throw new Error('Task ID and Status headers must be unique.');
let archive = ss.getSheetByName(ARCHIVE_SETTINGS.archiveSheet);
const archiveHeaders = headers.concat(['Archived At']);
if (archive && archive.getLastRow() > 0) {
const existing = archive.getRange(1, 1, 1, archiveHeaders.length)
.getDisplayValues()[0];
if (JSON.stringify(existing) !== JSON.stringify(archiveHeaders))
throw new Error('Archive headers differ; stop and inspect.');
}
const existingIds = new Set();
if (archive && archive.getLastRow() > 1) {
archive.getRange(2, idIndex + 1, archive.getLastRow() - 1, 1)
.getDisplayValues().forEach(r => existingIds.add(String(r[0]).trim()));
}
const result = {candidates: 0, moved: 0, skipped: 0};
const bottom = Math.min(lastRow, source.getLastRow());
for (let rowNum = bottom; rowNum >= Math.max(2, firstRow); rowNum--) {
const values = source.getRange(rowNum, 1, 1, headers.length)
.getValues()[0];
if (!isCompleted_(values[statusIndex])) continue;
result.candidates++;
const id = String(values[idIndex] || '').trim();
if (!id || existingIds.has(id)) {
result.skipped++;
console.log('Skipped row ' + rowNum + ': Task ID missing or in archive.');
continue; // Never delete an ambiguous original.
}
if (previewOnly) continue;
if (result.moved >= ARCHIVE_SETTINGS.maxRowsPerRun) break;
if (!archive) archive = ss.insertSheet(ARCHIVE_SETTINGS.archiveSheet);
if (archive.getLastRow() === 0)
archive.getRange(1, 1, 1, archiveHeaders.length).setValues([archiveHeaders]);
// Prefix potentially formula-like text before writing into archive.
const safe = values.map(safeText_);
archive.getRange(archive.getLastRow() + 1, 1, 1, safe.length + 1)
.setValues([safe.concat([new Date()])]);
SpreadsheetApp.flush();
source.deleteRow(rowNum); // Only after successful archive write.
existingIds.add(id);
result.moved++;
}
SpreadsheetApp.flush();
return result;
} finally {
lock.releaseLock();
}
}
function readHeaders_(sheet) {
const last = sheet.getLastColumn();
if (last < 1) throw new Error('Sheet has no headers.');
return sheet.getRange(1, 1, 1, last).getDisplayValues()[0]
.map(x => String(x).trim());
}
function isCompleted_(value) {
if (value === true) return true; // Checkbox in Status column.
return ['done', 'completed'].includes(String(value).trim().toLowerCase());
}
function safeText_(value) {
if (typeof value === 'string' && /^[\s]*[=+@\-]/.test(value))
return "'" + value; // Prevent unintended formula evaluation.
return value;
}
What Makes This Script Different?
The script includes several safeguards that are useful for practical workflows.
Preview mode: It begins with previewOnly: true, preventing row movement until you explicitly enable it.
Unique task IDs: It checks whether a task has already been archived.
Document locking: It uses Google’s LockService to reduce simultaneous-edit conflicts.
Bottom-up processing: It processes selected rows from bottom to top so deleting one row doesn’t change the position of remaining rows awaiting processing.
Archive timestamps: It records when each task was transferred.
Source preservation on duplicate IDs: If an archived task already uses the same ID, the script skips the source row rather than deleting it.
These measures reduce common problems, but they are not a substitute for backups or a transactional database.
Step 6: Run the Safe Preview
Before enabling row movement, save the Apps Script project.
Return to your spreadsheet and reload the page.
A new menu should appear:
Task Archive
Select:
Task Archive → Preview completed rows
The script scans the Active Tasks worksheet and counts matching records.
It should identify the fictional Completed and Done rows from our sample dataset.
What Does the Preview Do?
It reports how many rows are eligible for archiving.
It also reports rows skipped because of missing or already archived task IDs.
It does not create the archive or delete source rows.
What If the Menu Does Not Appear?
Make sure:
- You saved the Apps Script project.
- The script is attached to the spreadsheet.
- You refreshed Google Sheets.
- The function is named
onOpen. - You have permission to edit the spreadsheet.
Google documents how the onOpen and onEdit simple triggers work.
Step 7: Enable Automatic Row Archiving
Once you have confirmed that the script identifies the correct sample records, return to Apps Script.
Find:
previewOnly: true
Change it to:
previewOnly: false
Save the project.
Important: Make a backup of your test spreadsheet before this change.
Now select:
Task Archive → Archive completed rows
The script should move the fictional Completed and Done records to Completed Tasks.
Expected Result
The Active Tasks worksheet retains unfinished tasks.
The Completed Tasks worksheet contains the archived records and an Archived At column.
Test Automatic Archiving
Choose a remaining fictional task.
Change its Status to:
Completed
The script should move it automatically.
Do I Need to Install an Edit Trigger?
No.
The function is named onEdit(e), which is a built-in simple trigger for directly edited cells.
You do not need to install a second edit trigger for this function.
Adding an additional installable trigger that calls the same function could cause unnecessary duplicate executions.
Step 8: Test Multiple Edited Rows
The script supports direct spreadsheet edits that affect more than one row.
For example, you may paste Completed into several Status cells simultaneously.
The script checks whether the edited range intersects the Status column.
It then processes the affected rows from bottom to top.
Why Process Rows Backward?
Suppose rows 4, 5, and 6 are completed.
If a script deletes row 4 first, the original rows 5 and 6 move upward.
A poorly designed script may then skip rows or process the wrong records.
Processing from bottom to top avoids that common indexing problem.
Bulk Editing Limitation
This example handles direct edit events affecting up to 20 rows.
For larger pastes, it intentionally leaves the data unchanged so you can use the menu-based cleanup instead.
The menu can archive up to 50 matching rows per execution.
Run it again if more eligible tasks remain.
These are protective application limits in our sample code, not universal Google Sheets maximums.
Step 9: Handle Duplicate Task IDs Safely
Imagine you already archived:
TASK-1003
Later, someone adds another completed row with the same ID.
A basic script might append that row and delete the original without checking anything.
Our script compares task IDs against the Completed Tasks archive before writing.
If the ID Already Exists
The script skips that source row.
It does not overwrite the existing archive entry.
It does not delete the new source row.
The employee should review the identifier and decide whether the record is a duplicate or a separate task that needs a new ID.
What If the Script Stops After Writing but Before Deleting?
Moving data between two worksheets is not an atomic database transaction.
An interruption could leave the same task in both locations.
The duplicate-ID check helps prevent another archived copy from being added during a later run, but it does not automatically resolve the inconsistent record.
A person should inspect and reconcile the two copies.
Why Task IDs Should Never Be Reused
Identifiers make it possible to distinguish one task from another even when titles or employees are similar.
For production systems, use stable, unique IDs rather than relying on task descriptions.
Step 10: Create a Simple Task Archive Dashboard
After collecting archived records, you can build a small dashboard in another worksheet.
Name it:
Dashboard
Count Active Tasks
Assuming each active task has a Task ID in column A:
=COUNTA('Active Tasks'!A2:A)
Count Archived Tasks
=COUNTA('Completed Tasks'!A2:A)
Count Active Tasks Assigned to an Employee
For example, if Owner is column C:
=COUNTIF('Active Tasks'!C2:C,"Alex")
Count Tasks Archived Today
If the Archived At timestamp is in column G:
=COUNTIFS('Completed Tasks'!G2:G,">="&TODAY(),'Completed Tasks'!G2:G,"<"&TODAY()+1)
The date-based formula uses the spreadsheet’s timezone.
It counts when records were archived, which may differ from when the underlying work was actually completed.
Why This Distinction Matters
If you mark a task Completed on Monday but archive it on Tuesday, Archived At records Tuesday.
If you need an exact task completion timestamp, create and maintain a separate Completed At field before archiving.
Do not treat the archive date as a confirmed work completion date.
Step 11: Common Google Sheets Archiving Problems
Problem 1: onEdit Doesn’t Run
First verify that the function is named:
onEdit(e)
Then confirm you’re editing a cell directly in Google Sheets.
Google’s simple triggers do not run when cell values are changed through Apps Script executions or API requests.
This also means changing a cell through another script doesn’t automatically invoke onEdit.
If another automation changes task statuses, consider an appropriate scheduled cleanup or an explicit function call from that automation.
An installable edit trigger alone does not turn API-generated edits into normal human edit events.
Problem 2: Completed Rows Stay in Active Tasks
Check whether:
previewOnly: true
is still enabled.
This is the default safe mode.
Also confirm that the Status value is Done or Completed and the sheet is named Active Tasks.
Problem 3: The Wrong Row Moves
Check the source sheet headers.
The script finds the Status column by heading name rather than relying on a permanently fixed column number.
However, the source layout still needs valid, unique headings.
Problem 4: The Archive Contains No Headers
If the archive is missing or empty, the script creates the required headers when performing its first successful transfer.
If an existing archive has different headings, the script stops.
Don’t reorder archive columns without reviewing the code and matching the intended structure.
Problem 5: A Row Has a Duplicate Task ID
The script leaves that row in Active Tasks.
Review the task identifier and the archive record.
Do not delete either copy until you’ve confirmed which one should be retained.
Problem 6: A Formula Disappears After Moving
The sample script copies calculated cell values.
It does not preserve formulas.
For example, if a task’s Notes field contains a formula, the archived record stores its evaluated result rather than the formula itself.
This behavior is intentional for a historical archive, but it may not be suitable for spreadsheets that rely on preserving formulas.
Problem 7: Formatting Is Missing
The script transfers values, not source formatting, conditional formatting, comments, or notes.
If you need a visually formatted archive, configure the destination worksheet separately.
Problem 8: Checkbox Changes Don’t Archive
Make sure the checkbox is in the column headed Status.
The script recognizes Boolean TRUE as a completed state.
If you placed the checkbox in another column, update the script’s configuration and status-handling logic.
Problem 9: Pasting a Large Block Does Nothing
The example deliberately skips automatic edit events covering more than 20 rows.
Use:
Task Archive → Archive completed rows
This processes matching tasks in controlled batches.
Problem 10: The Script Times Out
Google’s simple triggers have execution-time restrictions, including a maximum of 30 seconds.
Moving many individual rows through repeated delete operations can be slow.
For much larger datasets, use a batched or scheduled architecture that has been specifically tested against the workload.
Problem 11: onEdit Misses Rapid Changes
Google documents that simple onEdit triggers queue only a limited number of events.
A very busy collaborative spreadsheet may therefore require a more reliable periodic reconciliation process.
A menu-based cleanup can help process completed rows that remain in the source.
Problem 12: The Task Archive Menu Is Missing
Refresh the spreadsheet after saving the script.
Ensure the project is spreadsheet-bound and that onOpen has not been renamed or removed.
Also check Apps Script execution logs for errors.
Can Google Sheets Archive Completed Rows Automatically Every Night?
Yes, but this requires a different scheduling configuration.
Google Apps Script supports installable time-driven triggers.
For example, you could execute archiveCompletedRows periodically.
However, the sample archiveCompletedRows function displays a user-interface alert.
For unattended scheduled operation, modify it to call the underlying archival function without relying on a spreadsheet UI dialog.
Also ensure preview mode has been disabled only after testing.
Google’s installable trigger documentation explains how scheduled triggers are configured.
Which Approach Is Better?
Immediate editing: Appropriate for a relatively small spreadsheet where users change task statuses manually.
Daily cleanup: Useful for larger teams that can tolerate completed tasks remaining visible until the scheduled archive runs.
Formula-based view: Better if the business needs all original rows to remain in one master table.
When Not to Move Completed Rows Automatically
Automatic row movement isn’t always the best design.
Consider using a filter or separate dashboard instead when:
- Other formulas depend on fixed row positions.
- Reports reference the original worksheet’s complete history.
- An external integration expects records to stay in place.
- Multiple applications update the same spreadsheet.
- You need a complete audit trail.
- Employees frequently reopen completed tasks.
- Deleting source rows could interrupt existing automations.
For these workflows, keeping one master table and filtering by status may be safer.
Alternative: Preserve Every Row
One practical design is to keep all tasks in a single Master Tasks worksheet.
Use filtered views or formulas to display:
- Active tasks.
- Completed tasks.
- Overdue tasks.
- Tasks by employee.
This avoids deleting source rows altogether.
Our Google Sheets task tracker with email reminders explains how task records can support assignments and notifications without relying exclusively on archival movement.
Combining Row Archiving With Other Google Sheets Automations
Archiving becomes more useful when it’s part of a broader, carefully designed spreadsheet workflow.
Task Reminder Automation
You may want to stop reminding employees about tasks that have been completed.
A reminder script can filter out Done and Completed statuses or use a separate Active Tasks tab.
Status-Change Notifications
A business might send an internal notification when a task reaches a particular stage.
Our guide to sending email when a Google Sheets cell changes covers related edit-trigger and notification concepts.
Remember that sending email generally requires an appropriately authorized trigger or execution context.
CSV Imports
Some teams load external records into spreadsheets using CSV files.
If the import is performed by a script, the normal onEdit function won’t automatically run for those inserted values.
A suitable design is to call the archival logic explicitly after importing or use a scheduled reconciliation process.
For an import workflow example, see our guide to combining CSV files in Google Sheets.
Data Safety Checklist Before Production Use
The sample code is designed for small, testable task-management workflows.
Before using it with business data, review these requirements:
- Maintain a separate backup of the spreadsheet.
- Test with fictional tasks before moving real records.
- Use unique task IDs.
- Review who can edit the archive worksheet.
- Confirm that formulas and formatting do not need to be preserved.
- Ensure downstream automations do not rely on stable row numbers.
- Verify the spreadsheet timezone.
- Define a process for restoring an archived task.
- Monitor execution errors and skipped IDs.
- Avoid using this prototype as the sole system of record for regulated or critical business workflows.
Security Note
The script includes a helper that prefixes certain potentially formula-like text values before inserting them into archive cells.
This reduces the risk of treating imported text as a spreadsheet formula.
It is still necessary to validate external data sources and apply appropriate spreadsheet permissions.
Frequently Asked Questions
How do I automatically move completed rows in Google Sheets?
Use a spreadsheet-bound Apps Script function named onEdit(e) to detect when the Status field changes to Done or Completed. The script can append the row’s values to an archive and then delete the original.
Can Google Sheets move an entire row when a checkbox is checked?
Yes. An Apps Script trigger can identify a checked checkbox and move the corresponding row.
The code must refer to the correct checkbox column.
Do I need an add-on to move completed rows automatically?
No. Google Apps Script can provide this functionality without a third-party add-on.
How do I move completed tasks to another tab?
Create an Active Tasks worksheet and a Completed Tasks worksheet. Use Apps Script to read a task’s status, append matching values to the archive, and remove the source row after successful writing.
Can I automatically add the completion date?
Yes, but distinguish between the work completion date and the archive date.
The example automatically adds an Archived At timestamp.
Will the script preserve my formulas?
No. The example transfers values rather than formulas.
If you need formulas preserved, the implementation must be adapted and tested.
Why does onEdit work manually but not with an imported CSV?
An import or API-driven update may not trigger Apps Script’s simple edit event.
Use a compatible batch-processing or reconciliation function for externally inserted records.
Does onEdit require a manual trigger setup?
No. A spreadsheet-bound function named onEdit(e) is recognized automatically for direct user edits.
Can I archive multiple completed rows at once?
Yes. The sample supports small multirow edits and provides a menu option for controlled batch archiving.
How do I prevent the same task from being archived twice?
Assign every task a unique ID and compare that ID against the archive before moving the row.
Can I restore an archived row?
Yes, manually, after reviewing its current status and identifying where it belongs.
A full automated restore workflow would require additional code and duplicate-ID handling.
Can I archive completed tasks every day?
Yes. You can adapt the script for a scheduled time-driven trigger. The unattended version should avoid interactive UI alerts.
Will Google Sheets automatically detect formula-driven status changes?
Not through the ordinary onEdit(e) event. Formula recalculations are not equivalent to a user directly editing the cell.
Is moving rows better than using a FILTER formula?
It depends on the workflow. Moving rows keeps the active table smaller but changes the source data. FILTER creates a separate view without deleting original rows.
Is the script suitable for large business databases?
The example is intended for smaller spreadsheet workflows. Large or highly concurrent datasets may require a more scalable architecture and stronger consistency controls.
Final Thoughts
Learning how to automatically move completed rows in Google Sheets can make a task tracker easier to maintain.
With a small Apps Script, you can detect completed tasks, archive their values, record an archive timestamp, and keep unfinished work visible in the main worksheet.
However, reliable automation requires more than a simple copy-and-delete command.
Unique task IDs, preview testing, archive validation, and careful handling of duplicate records all help reduce avoidable errors.
Begin with the fictional sample spreadsheet and confirm the expected behavior before enabling row deletion.
If your task tracker depends on complex formulas, external systems, or strict audit requirements, consider keeping all records in a master worksheet and using filtered views instead.
For more practical tutorials, explore Google Sheets task automation, automatic spreadsheet notifications, and CSV consolidation workflows on IA Network.
The best spreadsheet automation is one that saves time while keeping your data understandable, recoverable, and under your control.





