Grading scales, bonus tiers, payroll rules — they all start the same way: "if this, then that". Describe your logic as a plain list and ChatGPT writes a clean IF or IFS formula, chooses the right function for your Excel version, and adds the default case most people forget.
I need an IF or IFS formula in Excel. The score being tested is in cell B2. Valid scores are numbers from 0 to 100. Here's the logic: - 90 to 100 → "A" - 80 to 89.999... → "B" - 70 to 79.999... → "C" - 0 to 69.999... → "Fail" I'm using Excel [Microsoft 365 / Excel 2024 / Excel 2021 / Excel 2019 / Excel 2016]. Please use IFS if my version supports it; otherwise use nested IF. Return "Invalid" for blanks, text, negative numbers, or scores above 100.
Replace the logic and cell reference with your own, then paste the prompt into ChatGPT.
My nested IF formula is giving wrong results. Here's the formula: [paste formula] When the value in the test cell is [value], it returns [wrong result] instead of [expected result]. I'm using Excel [Microsoft 365 / Excel 2024 / Excel 2021 / Excel 2019 / Excel 2016]. Please identify the logic error, explain why it happens, and give me a corrected formula that works in my Excel version.
Wrong results at a boundary value (e.g. exactly 80) almost always mean a > vs >= mistake.
I need an IF or IFS formula for bonus calculation. Performance score is in C2 and base salary is in D2. Valid scores are whole numbers from 1 to 5. Rules: - Score 5 → 20% of salary - Score 4 → 10% of salary - Score 3 → 5% of salary - Score 1 or 2 → no bonus I'm using Excel [Microsoft 365 / Excel 2024 / Excel 2021 / Excel 2019 / Excel 2016]. Please calculate the bonus amount and return "CHECK SCORE" if C2 is blank, text, outside 1–5, or not a whole number. Make sure the validation does not evaluate numeric functions such as INT, MOD, or arithmetic comparisons on text or blank inputs before confirming that C2 contains a number.
Swap in your own score-to-percentage rules — ChatGPT keeps the structure, you change the numbers.
=IF(OR(NOT(ISNUMBER(B2)),B2<0,B2>100),"Invalid", IFS(B2>=90,"A",B2>=80,"B",B2>=70,"C",TRUE,"Fail")) Valid range: 0–100. Unexpected inputs are flagged instead of silently graded.
=IF(B3>=90,"A",IF(B3>=80,"B",IF(B3>=70,"C","Fail"))) Only the boundary operators changed: > became >=. 90 → A · 80 → B · 70 → C ✓
=IF(NOT(ISNUMBER(C2)),"CHECK SCORE",
IF(OR(C2<1,C2>5,C2<>INT(C2)),"CHECK SCORE",
IFS(C2=5,D2*20%,C2=4,D2*10%,C2=3,D2*5%,TRUE,0)))
Fill down through F6.
£9,600 + £5,200 + £1,900 + £0 + £0 = £16,700 ✓
Before opening ChatGPT, list your conditions clearly — 90 or above → A, 80 or above → B, and so on. This list becomes your prompt. The clearer the list, the better the formula.
IFS is available in Microsoft 365 and Excel 2019, 2021 and 2024. Also specify exactly which cell contains the value being tested — for example "the score is in B2" — so the formula is ready to paste directly.
ChatGPT explains each condition in plain English alongside the formula. Read it — this is the best way to catch a logic error like a > that should be >= before it spreads across your data.
Always test with the cutoff values themselves — 90, 80, 70, 69. Boundary cases are where IF formulas most often fail. One character makes the difference.
Make sure the formula handles edge cases explicitly — blank cells, text in a numeric field, and values outside the valid range. Use validation tests and a final default result where appropriate; do not use IFERROR merely to hide a logic or input error.
TRUE,"—" (or another default result) as the final pair. If every logical test is FALSE and there is no default pair, IFS returns #N/A.