flaibo
Sign in
Formula Script

Plain Description to Spreadsheet Formula With Tests

Describe a calculation in words and get a spreadsheet formula, an explanation of each part, test cases with expected results and the edge cases to try.

No card required

What this prompt does

Almost everyone can say what they want a spreadsheet to calculate, and fewer can turn it into the right formula, especially with exceptions such as only in the north region, excluding credits, rounded to the nearest week. A formula that gets the first example right can still fail on blanks, text or a new row. This prompt starts by restating your request, which exposes ambiguity at once. It then writes the formula with a plain explanation of each part, provides test cases including your own sample rows with expected results, and lists the edge cases that would break it with ways to guard against each. Because the AI cannot run it, you get a manual check to verify the answer independently.

The prompt

You are helping me write a spreadsheet formula from a plain description. I will give you my column layout and what I want to calculate. You cannot see my file, so base everything on what I tell you and ask if something is unclear.

What I want to calculate, in plain words: [DESCRIPTION, INCLUDING ANY RULES AND EXCEPTIONS]
My layout: [COLUMNS WITH LETTERS, HEADERS, DATA TYPE, AND THE ROW WHERE DATA STARTS; EXAMPLE: A = Date, B = Region, C = Amount]
Where the result goes: [CELL OR COLUMN]
Sample rows with invented values: [PASTE 5 TO 8 ROWS]
The result I expect for those rows: [EXPECTED RESULTS]
Tools I use: [NAME OF THE SPREADSHEET PROGRAM, OR 'GENERIC' IF UNSURE]
How the data changes: [ROWS ADDED, BLANKS POSSIBLE, TEXT ENTRIES POSSIBLE]

Produce: 1. Your understanding of the request in two sentences, with any ambiguity as a question. 2. The formula, in a code block, using standard functions, and a simpler alternative if one exists. 3. A part-by-part explanation in plain language. 4. A table of test cases: input, what the formula should return, and why, including my sample rows. 5. Edge cases that may break it: blanks, text instead of numbers, duplicates, new rows beyond the range, upper and lower case, dates stored as text. For each, say what happens and how to guard against it. 6. How to check the result independently, for example a quick manual calculation on three rows.

Rules: do not invent function names; if the program I use has a different name for a function, say so; do not claim the formula is verified, since you cannot run it; keep it as simple as the problem allows.

Before answering, work through my sample rows by hand and check that the formula gives my expected results.

How to use it

Use invented sample rows rather than real data. After pasting the formula, run your sample rows and compare them with the expected results before trusting it on the full sheet. If the function names differ in your program, adjust them using the program's own help.

See it in action

Filled-in prompt

What I want to calculate, in plain words: Sum the amount for rows where the region is North and the date is in the current month, ignoring rows marked 'Credit' in the status column. My layout: A = Date, B = Region, C = Amount, D = Status; data starts in row 2. Where the result goes: F2. Sample rows with invented values: 2026-11-03, North, 100, Paid; 2026-11-10, North, 50, Credit; 2026-11-12, South, 80, Paid; 2026-10-30, North, 70, Paid. The result I expect for those rows: 100 (if the current month is November). Tools I use: Generic. How the data changes: Rows added weekly; status sometimes blank.

Expected output

1. Understanding: Add up column C where B is North, the date is in the current month and D is not Credit. Question: should blank status count? I assume yes. 2. Formula =SUMIFS(C2:C1000, B2:B1000, "North", A2:A1000, ">="&DATE(YEAR(TODAY()),MONTH(TODAY()),1), A2:A1000, "<"&DATE(YEAR(TODAY()),MONTH(TODAY())+1,1), D2:D1000, "<>Credit") 3. Explanation: SUMIFS adds column C when every condition is true: region equals North; date on or after the first of this month; date before the first of next month; status is not Credit. 4. Tests Row 1: 100 counted. Row 2: credit, excluded. Row 3: South, excluded. Row 4: October, excluded. Expected 100. 5. Edge cases: dates stored as text will not match; the range stops at row 1000; 'north' in lower case still matches in most programs; blank status counts as not Credit. 6. Check: add up the matching rows by hand.

A formula looks right on one example and fails on the next row.

Test cases and edge cases are listed with expected results.

Describing the rule in words leaves gaps.

The prompt restates your request and asks about any ambiguity.

You trust a formula you cannot verify.

A manual check method lets you confirm the result independently.

Frequently asked questions

Should I paste my real spreadsheet?

No. Use a few invented rows with the same layout. Do not paste real data, customer data or confidential figures.

Will the formula work in my program?

Probably, if the functions are standard, but the AI cannot run it. Test with your sample rows, and check the program's help for function names.

What if the formula is too complex?

Ask for a simpler version or split the calculation across helper columns.

Ready to use Plain Description to Spreadsheet Formula With Tests?

Save your column layouts as notes in Flaibo, and the Prompt Builder uses them with your profile when you build the next formula prompt.

Get started free

Your context everywhere