Build a multi-condition Excel IF formula

Auteur: AILesson5 min de préparationTesté avec:ChatGPTRévisé: 2026-08-28

Réponse rapide

Turn ordered business rules into a formula with explicit precedence and edge cases. Fournir: Business rules, Columns and data types, Example cases. Résultat attendu: A reviewable IF or IFS formula with a decision table and tests.

1

Ajouter votre contexte

Votre texte reste dans ce navigateur. AILesson Prompts ne l’envoie ni à un modèle ni à un serveur.

2

Votre prompt

Les champs non remplis restent visibles sous forme d’espaces réservés, afin que vous puissiez quand même copier et modifier le 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.
Essayer dans le Playground
Privé par défautL’assemblage du prompt se fait localement dans votre navigateur. Évitez de placer des informations confidentielles dans un service d’IA, sauf si votre organisation l’autorise.

De l'entrée au résultat

Un exemple détaillé

Voyez comment un contexte concret transforme cette recette en résultat utilisable.

Entrée réelle

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.

Exemple de sortie

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.

Pourquoi cela fonctionne

  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.

Vérifier le résultat

  • Does each possible input reach one intended branch?

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

  • Is the fallback visible and authorized?

Utilisez-la en toute confiance

Questions fréquentes

Des réponses pratiques sur le bon moment pour utiliser cette recette, ce qu’il faut fournir et les cas où une vérification humaine reste nécessaire.

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.

Plus de façons d'explorer

Où se situe cette recette

Faites avancer votre travail