Conditional Formatting & Data Validation Rule Generator
Pick a rule, type your range, and this conditional formatting formula generator writes the exact formula with the right $ signs. You also get the click-by-click steps for both Excel and Google Sheets.
- Free to use
- No account required
- Instant results
- Sent to the AI only when you press the button
Rule library (works in your browser)
Conditional formatting formula
=$D2="Done"
- Applies to
- A2:F100
- Format
- Light green fill, dark green text (fill #C6EFCE, text #006100)
In Excel
- Select A2:F100, starting from A2 so that A2 is the active (white) cell.
- Home > Conditional Formatting > New Rule.
- Choose “Use a formula to determine which cells to format”.
- In “Format values where this formula is true”, paste: =$D2="Done"
- Click Format… > Fill, pick #C6EFCE (and the font colour #006100 on the Font tab), then OK > OK.
In Google Sheets
- Select A2:F100.
- Format > Conditional formatting.
- Check that “Apply to range” says A2:F100.
- Under “Format cells if…”, choose “Custom formula is”.
- Paste: =$D2="Done"
- Under “Formatting style”, choose a custom fill #C6EFCE and text colour #006100, then click Done.
- The $ before D keeps every cell of the row looking at column D; the row number has no $ so it moves down row by row.
- Text comparison ignores upper and lower case.
Describe your own rule (AI)
Your custom rule
Example result (nothing was sent)Conditional formatting rule for A2:G200
Rule formula
=AND($E2="Overdue",$D2>1000)
Format: Light red fill (#FFC7CE) with dark red text (#9C0006)
In Excel
- Select A2:G200, starting from A2.
- Home > Conditional Formatting > New Rule.
- Choose “Use a formula to determine which cells to format” and paste the formula.
- Click Format…, choose the fill colour, then OK > OK.
In Google Sheets
- Select A2:G200.
- Format > Conditional formatting.
- Under “Format cells if…”, choose “Custom formula is” and paste the formula.
- Pick the formatting style, then Done.
- The $ before E and D keeps every cell of a row looking at columns E and D; the row number moves down row by row.
- Assumed: Amounts in column D are numbers, not text.
- Assumed: Status is spelled exactly Overdue (upper and lower case do not matter).
Your data: Your text is sent to our server and to the AI provider only when you press the button. We do not store it with your identity, and nothing is sent before that.
How to use
- Choose a rule from the library: duplicates, dates, rankings, blanks, text, whole rows, banding or data validation.
- Type the range it applies to, such as A2:F100, plus the column, value or number the rule needs.
- Copy the formula and follow the steps for your app. Excel and Google Sheets use different menus, and both are listed.
- For anything the library does not cover, describe the rule in plain English under Describe your own rule. Give the range and pick the app.
- Download the rule as a text file if you want to keep it.
Examples
Colour the whole row when a task is done. Rule "Highlight the whole row by one cell's value", range A2:F100, column D, value Done. The formula is =$D2="Done". The $ before D keeps every cell of the row looking at column D. Without it (=D2="Done"), column E would test E2 and the colour would land in the wrong places.
Find repeated customer IDs. Rule "Duplicates in one column", range B2:B100. The formula is =COUNTIF($B$2:$B$100,B2)>1. The list is fixed with $ signs and the tested cell moves down.
Overdue and large. Described in your own words: "highlight the row when Status in E is Overdue and Amount in D is over 1000", range A2:G200, Excel. The AI answers =AND($E2="Overdue",$D2>1000), and our check confirms the formula is anchored on row 2 of the range.
Tips and limits
- The library has 27 rules.
- Conditional formatting (19): duplicates in one column and across several columns, duplicate rows, unique values, overdue dates, due in the next N days, today, weekends, top N, top N percent, bottom N, above and below average, blanks, non-blanks, text contains, whole row by value, banding, and cells that differ from the cell above.
- Data validation (8): dropdowns from a range or a typed list, whole numbers between, dates between, text length, no duplicates, email-looking text and required cells.
- Library formulas are built in your browser; nothing is sent.
- Rules need a start row, so whole columns such as A:A are not accepted. Use A2:A1000.
- An AI rule is checked by our own code before you see it. We check that brackets and quotes balance and that every function exists. A warning appears when the formula does not point at the first row or column of the range, or when every row would test the same cell.
- Excel has no regular expressions before Microsoft 365. Pattern checks there use LEFT, MID and FIND and are approximate. Google Sheets can use REGEXMATCH.
- You can send 10 AI requests per 10 minutes. The library has no limit.
FAQ
How do I highlight duplicates?
Use "Duplicates in one column" for a single list, or "Duplicate rows" when a row only counts as a duplicate if all its columns match. Both use COUNTIF or COUNTIFS with an absolute range.
Why does my rule apply to the wrong row?
A rule formula is written for the first cell of the range. If the range starts at row 2 but the formula says D1, every row tests the row above. In Excel, also select the range from its first cell.
Can validation use another sheet?
Yes. A dropdown can take its list from another sheet in both Excel and Google Sheets, for example `=Lists!$A$2:$A$20`. Google Sheets conditional formatting cannot point at another sheet directly; wrap the range in INDIRECT.
What do the $ signs do?
A $ before the column letter fixes the column, and a $ before the row number fixes the row. `$D2` keeps column D for every cell but moves down row by row.
Does validation stop pasted values?
No. In both apps, pasting over a cell can replace its validation, and values already in the cells are not checked. Pair validation with a highlight rule.
Why do the steps say "starting from A2" for Excel?
Excel reads the formula relative to the active cell of your selection. Selecting from the first cell of the range makes the formula line up.
Privacy note
The rule library runs entirely in your browser and sends nothing. When you press Describe your own rule, the description, range and app are sent to our server and to the AI provider to write the rule. We do not store them with your identity, and identical requests may be answered from a short-lived cache. The example rule shown when the page opens is saved in the page and sends nothing.
Guides for this tool
Spreadsheet & Formula StudioHighlight a Whole Row Based on One Cell's Value
How to highlight a whole row in Excel or Google Sheets when one cell says Done: the =$D2="Done" formula, why the dollar sign matters, the steps and AND for two conditions.
4 min read
Spreadsheet & Formula StudioHighlight Duplicates in One Column With a Formula
How to highlight repeated IDs in one column with a COUNTIF conditional formatting rule: the fixed list, the moving cell, the steps for Excel and Google Sheets, and what to check.
3 min read
Spreadsheet & Formula StudioSend an Email When a Google Sheets Cell Changes
How to make Google Sheets email the owner when a Status cell becomes Done: the generated script, the installable trigger, the permissions and the quotas.
3 min read
Data Cleaning & File ConvertersRemove Duplicate Rows From a CSV File
How to remove duplicate rows from a CSV file: why cleaning comes first, the case option, the report and change log, and stacking two files without repeated rows.
4 min read