Build a multi-condition Excel IF formula

Autor: AILesson5 min de preparaciónProbado con:ChatGPTRevisado el: 2026-08-28

Respuesta rápida

Turn ordered business rules into a formula with explicit precedence and edge cases. Proporciona: Business rules, Columns and data types, Example cases. Resultado esperado: A reviewable IF or IFS formula with a decision table and tests.

1

Añade tu contexto

Tu texto permanece en este navegador. AILesson Prompts no lo envía a un modelo ni a un servidor.

2

Tu prompt

Los campos sin rellenar permanecen visibles como marcadores de posición, para que puedas copiar y editar el prompt

Create an Excel IF, IFS, or SWITCH formula for these rules:
[rules]

Workbook layout:
[layout]

Example cases and expected results:
[examples]

First convert the rules into an ordered decision table. Identify overlaps, gaps, ambiguous boundaries, and the fallback result. Do not write the formula until precedence is explicit. Then return the formula for the first data row, explain why IF, IFS, or SWITCH is appropriate, and test every branch including blanks, equal-to-boundary values, and a case matching more than one condition. Do not hide unexpected inputs unless a fallback is explicitly authorized.
Probar en Playground
Privado de forma predeterminadaLa preparación del prompt se realiza localmente en tu navegador. Evita introducir información confidencial en cualquier servicio de IA, a menos que tu organización lo permita.

De la entrada al resultado

Un ejemplo completo

Mira cómo un contexto concreto convierte esta receta en un resultado que puedes usar

Entrada real

Business rules
Status is 'Review' when score is blank. Status is 'Priority' when score is at least 90 and overdue days are greater than 0. Otherwise: score 90–100 is 'High', 70–89 is 'Medium', below 70 is 'Low'. Invalid scores below 0 or above 100 must show 'Invalid'.
Columns and data types
C: Score (number or blank); D: Overdue Days (whole number); E: Status. Data starts on row 2.
Example cases
C2=95,D2=2 => Priority; 95,0 => High; 90,0 => High; 70,0 => Medium; 69,0 => Low; blank => Review; 105 => Invalid.

Ejemplo de salida

Decision order: blank → Review; outside 0–100 → Invalid; score ≥90 and overdue >0 → Priority; score ≥90 → High; score ≥70 → Medium; otherwise → Low. The invalid check must precede the threshold branches, and Priority must precede High because both match a score of 90 or more.

E2 formula =IFS(C2="","Review",OR(C2<0,C2>100),"Invalid",AND(C2>=90,D2>0),"Priority",C2>=90,"High",C2>=70,"Medium",TRUE,"Low")

IFS is clearer than deeply nested IF because the rules are ordered predicates rather than a single exact-value mapping. Tests: 95/2 → Priority; 95/0 and 90/0 → High; 70/0 → Medium; 69/0 → Low; blank → Review; 105 → Invalid. Confirm whether a negative overdue value is valid and whether numeric text should be accepted before filling down.

Por qué funciona

  1. 1

    An ordered decision table exposes precedence before nested logic makes it hard to see.

  2. 2

    Testing overlaps and exact boundaries catches the most common classification mistakes.

Comprueba el resultado

  • Does each possible input reach one intended branch?

  • Are more specific or higher-priority conditions evaluated first?

  • Is the fallback visible and authorized?

Úsalo con confianza

Preguntas frecuentes

Respuestas prácticas sobre cuándo usar esta receta, qué debes proporcionar y en qué casos la revisión humana sigue siendo importante

What should I prepare before using “Build a multi-condition Excel IF formula”?

For “Build a multi-condition Excel IF formula,” prepare Business rules, Columns and data types, and Example cases. Replace placeholders only with information you can verify. If a detail is unknown, preserve that uncertainty explicitly instead of asking the model to infer it.

When is the “Build a multi-condition Excel IF formula” result not ready to use?

The result is not ready if it does not yet deliver the stated outcome—A reviewable IF or IFS formula with a decision table and tests—from the supplied evidence, or if it relies on unresolved assumptions, missing approvals, or invented details. Use the checks as release gates: revise the source inputs or assign a named, authorized reviewer instead of polishing an unsupported output.

Which AI tools have recorded tests for “Build a multi-condition Excel IF formula”?

The published test record for “Build a multi-condition Excel IF formula” lists ChatGPT as of 2026-08-28. This confirms recorded runs, not guaranteed compatibility or identical results in later product versions. For another tool or version, keep every constraint visible and repeat the result checks before use.

Más formas de explorar

Dónde encaja esta receta

Mantén el trabajo en marcha