Create intermediate Works with: Any AI

Nested IF to IFS and SWITCH Simplifier

Before after Has example

Rewrite tangled logic into readable formulas.

The Open buttons send the prompt text as currently shown below to that site only when you click. Fill in the placeholders first.

Rate this prompt

Loading ratings…

Simplify my complicated logical formulas. App and version: [SPREADSHEET_APP_AND_VERSION]. The current formula: [PASTE_FORMULA]. What it is supposed to do in plain words: [PLAIN_DESCRIPTION]. Sample inputs and expected outputs (fake): [TEST_CASES].

Return:
BEFORE: the original formula, indented to show its structure, with problems marked ([deep nesting], [repeated calculation], [hardcoded values], [order of conditions matters], [missing default case]).
LOGIC TABLE: a table of conditions and results that describes the rules clearly.
AFTER (three options): 1) IFS with a final TRUE default; 2) SWITCH for exact matches; 3) a lookup table on a sheet (best when rules change often), with the formula that reads it, including approximate match for bands.
TESTS: run my test cases through each version and show the results side by side so I can confirm they match the original.
RECOMMENDATION: which to use and why; how to document the rules; and how to avoid putting constants inside formulas (move thresholds to labeled input cells).

Explain the logic order issue (the first true condition wins) and the risk of overlapping bands. Provide a fallback for versions without IFS or SWITCH. Do not change the logic unless I ask; if you find a bug, report it separately.

Fill in before use

Optional: type your details and the prompt above updates. Nothing is saved or sent.

Replace each bracketed placeholder with your own details, then paste into Any AI or another assistant.

See an example result (fictional data)
BEFORE: =IF(A2>=90,"A",IF(A2>=80,"B",IF(A2>=70,"C",IF(A2>=60,"D","F")))) [deep nesting] [hardcoded values]
LOGIC TABLE: 90+ = A; 80-89 = B; 70-79 = C; 60-69 = D; below 60 = F.
AFTER 1: =IFS(A2>=90,"A", A2>=80,"B", A2>=70,"C", A2>=60,"D", TRUE,"F")
AFTER 3 (lookup table, best when rules change): =XLOOKUP(A2, Bands!A2:A6, Bands!B2:B6, , -1)
TESTS: 95 -> A; 80 -> B; 59 -> F; all three versions agree. Order matters: the first true condition wins. Thresholds belong in labeled cells or a table, not inside the formula, so a rule change needs no formula edit. If a bug is found in the original, report it separately and do not change behavior silently.

Illustrative only, made-up data. Your results will differ and must be reviewed.

Related prompts