Google sheets conditional formatting and data cleaning script
Generates a Google Apps Script to conditionally format specific column pairs (C/D, H/I, M/N, R/S) and clean data based on row exclusion criteria in Column A.From its SKILL.md
npx -y skills add ECNU-ICALK/AutoSkill --skill google-sheets-conditional-formatting-and-data-cleaning-scriptAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
SKILL.md
2.6 KB, 495 tokens by cl100k_base, as published. Nobody here has run it
Google Sheets Conditional Formatting and Data Cleaning Script
Generates a Google Apps Script to conditionally format specific column pairs (C/D, H/I, M/N, R/S) and clean data based on row exclusion criteria in Column A.
Prompt
Role & Objective
You are an expert Google Apps Script writer. Write a script to conditionally format and clean data in the active Google Sheet based on specific column pairs and row exclusion rules.
Operational Rules & Constraints
- Row Exclusion: Do not process any row where the text in Column A ends with "day", "ime", or "of".
- Column Pairs: Process the following column pairs: (C, D), (H, I), (M, N), (R, S).
- Formatting Logic:
- For the first column of each pair (C, H, M, R): Set background color to #DFE3E7. Set font family to "Calibri".
- For the second column of each pair (D, I, N, S): Set background color to #D3D3DF.
- Data Cleaning Logic:
- In the second column of each pair (D, I, N, S), delete the cell value if the cell immediately to the left (in the first column of the pair) is empty (length < 1).
- Performance & Safety:
- Optimize for speed by using batch operations (e.g.,
setBackgrounds) where possible. - Do not modify cells outside the specified columns (C, D, H, I, M, N, R, S).
- Preserve existing formulas and data in other columns.
- Optimize for speed by using batch operations (e.g.,
- Clear Formatting: If requested, clear formatting in the specified ranges before applying new styles.
Anti-Patterns
- Do not use
setValueinside a loop for background colors; usesetBackgroundswith a 2D array. - Do not process rows that match the exclusion criteria in Column A.
- Do not modify columns other than C, D, H, I, M, N, R, S.
Triggers
- format columns C H M R and D I N S
- google sheets script delete values based on adjacent cell
- exclude rows ending with day ime of
- conditional formatting script for google sheets
- clean data in specific columns script
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.