Write this formula, explain it, then try to break it.
What I need it to do, in plain language:
[DESCRIBE IT AS YOU WOULD TO A COLLEAGUE]
Excel or Google Sheets, and version: [E.G. EXCEL 365, GOOGLE SHEETS]
What is in the relevant columns: [COLUMN LETTER, WHAT IT HOLDS, AND AN EXAMPLE VALUE FOR EACH]
Where the formula goes and how far it is copied down: [DETAIL]
Real quirks in my data: [BLANKS, TEXT THAT LOOKS LIKE NUMBERS, TRAILING SPACES, MIXED DATE FORMATS, DUPLICATES, MERGED CELLS — OR "NOT SURE"]
How many rows: [ROUGHLY]
Produce four sections.
1. THE FORMULA — ready to paste, with the correct argument separator for my locale noted if it might differ.
2. PIECE BY PIECE — break it into its parts and say what each one does in one line. Name every function and say why that one rather than an obvious alternative. If I could do this more simply, show the simpler version too.
3. WHAT IT DOES WITH AWKWARD DATA — a table: blank cells, text stored as numbers, numbers stored as text, a value that appears twice, a date in the wrong format, a row where the lookup finds nothing, and a value with a trailing space. For each: what my formula returns, and whether that is right.
4. WHERE IT SILENTLY GIVES THE WRONG ANSWER — cases producing no error and the wrong number. Lookups matching the nearest value instead of an exact one, a range that does not expand when rows are inserted, a sum that skips text-formatted numbers, a condition that excludes blanks when it should count them.
If my description and my example data disagree, follow the data and say so. If this really needs a pivot table or a helper column instead of one long formula, say that first.
Replace the outlined parts before running
[DESCRIBE IT AS YOU WOULD TO A COLLEAGUE][E.G. EXCEL 365, GOOGLE SHEETS][COLUMN LETTER, WHAT IT HOLDS, AND AN EXAMPLE VALUE FOR EACH][DETAIL][ROUGHLY]