IFS が誤った値または #N/A を返す

72点が A になる、ほとんどが D になる、空白が F になる、#N/A が出る、これらは別の原因です。末尾に TRUE を足すだけでは、条件が一つも当てはまらない場合しか直りません。2026 年 11 月 14 日の Google Sheets のテストでは、修正後の数式は標本に対して A、A、B、B、C、空白、D、F を返しました。

目次

要点

72点が A になる、ほとんどが D になる、空白が F になる、#N/A が出る、これらは別の原因です。末尾に TRUE を足すだけでは、条件が一つも当てはまらない場合しか直りません。2026 年 11 月 14 日の Google Sheets のテストでは、修正後の数式は標本に対して A、A、B、B、C、空白、D、F を返しました。

=IFERROR(IF(B2="","",IFS(--B2>=90,"A",--B2>=80,"B",--B2>=70,"C",--B2>=60,"D",TRUE,"F")),"Check score")

確認のポイント

条件は高い順に書きます。そうしないと 90 点が >=60 で止まって D になります。文字列の 72 は Sheets で >=90 だけでなく >=1000 も TRUE になり、変換しない IFS は A を返します。-- または VALUE で変換すると C になります。空白の B7<60 は TRUE、--B7 は 0 で、判定を入れない IFS は F になります。

注意点と互換性

境界は >= を使います。ちょうど 90 に > を使うと B になります。テストが #DIV/0! のとき、末尾の TRUE では救えず、エラーがそのまま返ります。IFERROR と ISERROR で処理すると Check score になります。段階が四五を超えるなら、昇順の閾値表で XLOOKUP(一致モード -1)または VLOOKUP(TRUE)を使い、この表では IFS と同じ 8 個の評定になりました。今回 Excel では再確認していません。

英語の詳細例・数式・著者メモ

A score of 72 comes back as an A, almost every row is a D, a blank gets an F, or a few cells show #N/A. Those are different problems. Adding TRUE at the end only fixes the last one.

Type this into A1:B9. In B6, type a leading apostrophe before 72 ('72) so the cell displays 72 but is stored as text, the way a score often arrives from a CSV or a web form. Leave B7 empty.

StudentScore
Maya Chen94
Luis Garcia90
Nia Patel87
Omar Hassan80
Priya Shah72
Remy Brooks
Sofia Kim60
Theo Martin59

The bands are A for 90 or above, B for 80–89, C for 70–79, D for 60–69, and F below 60. A missing score should stay ungraded.

In C2, fill down to C9:

=IFERROR(IF(B2="","",IFS(--B2>=90,"A",--B2>=80,"B",--B2>=70,"C",--B2>=60,"D",TRUE,"F")),"Check score")

C2:C9 returns A, A, B, B, C, blank, D, F. The -- turns numeric text into a number, the IF leaves an empty score blank, the tests run from high to low, TRUE,"F" catches anything below 60, and IFERROR shows “Check score” when the input can’t be converted. I ran these checks in Google Sheets on 14 November 2026.

No condition matches, so IFS returns #N/A

Theo’s 59 in B9 matches none of these four tests, so this formula returns #N/A:

=IFS(B9>=90,"A",B9>=80,"B",B9>=70,"C",B9>=60,"D")

Add a final pair. =IFS(B9>=90,"A",B9>=80,"B",B9>=70,"C",B9>=60,"D",TRUE,"F") returns F. Wrapping the same four-test formula in IFNA also returns F. I’d use the TRUE pair: it states the default. IFNA will also replace an #N/A that came from inside a more complicated test; when to mask an error is in IFERROR vs IFNA.

Tests that start too low turn a 90 into a D

IFS stops at the first TRUE. =IFS(B3>=60,"D",B3>=70,"C",B3>=80,"B",B3>=90,"A",TRUE,"F") returns D for Luis’s 90, because B3>=60 is already TRUE. Every numeric score of 60 or more would get D with that order.

For >= bands, put the highest cutoff first: =IFS(B3>=90,"A",B3>=80,"B",B3>=70,"C",B3>=60,"D",TRUE,"F") returns A. If you write the tests as “below 60, below 70,” the order goes the other way, lowest first. Nested IF follows the same first-true-wins rule.

Imported 72 gets an A because it’s text

This is the one I’d look at first when hand-typed scores grade correctly and imported ones jump to the top band.

Priya’s B6 displays 72 but is text: =ISNUMBER(B6) returns FALSE. This formula returns A, not C:

=IFS(B6>=90,"A",B6>=80,"B",B6>=70,"C",B6>=60,"D",TRUE,"F")

In Google Sheets, =B6>=90 and even =B6>=1000 both returned TRUE. The comparison is not numeric. A text value ranks above a number, so the first test succeeds and IFS never looks at the later bands. I did not re-run those comparisons in Excel for this page.

Convert the score inside the tests. =IFS(--B6>=90,"A",--B6>=80,"B",--B6>=70,"C",--B6>=60,"D",TRUE,"F") returns C, and VALUE(B6) does the same. If B6 held a word such as absent, both conversions return #VALUE!; the opening formula’s IFERROR then shows “Check score”.

For a one-off import, I’d convert the column to real numbers rather than wrap every formula; converting numbers stored as text covers that. For a feed you re-import, keep the conversion in the formula.

Blank cells grade as F because they compare like zero

=B7<60 returns TRUE on the empty cell, and --B7 returns 0. An unguarded =IFS(B7>=90,"A",B7>=80,"B",B7>=70,"C",B7>=60,"D",TRUE,"F") therefore returns F: none of the positive cutoffs match, and the fallback treats the blank like a low score.

If a missing score should stay ungraded, test for it first. =IF(B7="","",IFS(B7>=90,"A",B7>=80,"B",B7>=70,"C",B7>=60,"D",TRUE,"F")) returns a blank. That also treats a formula that returns "" as missing; distinguishing that from a truly empty cell is in ISBLANK vs empty cells. A real score of 0 should still be F.

An exact 90 becomes B when the cutoff is >

=IFS(B3>90,"A",B3>80,"B",B3>70,"C",B3>60,"D",TRUE,"F") returns B for Luis’s 90, because B3>90 is FALSE and B3>80 is TRUE. If 90 belongs in the A band, use >=90. The same >= formula returns B for Omar’s exact 80 and D for Sofia’s exact 60.

TRUE does not catch an error inside a test

A final TRUE pair covers tests that come back FALSE. It does not catch a test that returns an error.

I put =1/0 in B11, which displays #DIV/0!. =IFS(B11>=90,"A",TRUE,"Not A") returns #DIV/0!, not “Not A”. Handle the failure in the test:

=IFS(IFERROR(B11>=90,FALSE),"A",ISERROR(B11),"Check score",TRUE,"Not A")

That returns “Check score” while B11 is an error, and “Not A” for Theo’s 59.

Use a threshold table once you have more than a few bands

IFS is fine for five grades. Once the list grows, I’d keep the cutoffs in a table. Enter this in E1:F6, with E2:E6 in ascending order:

Minimum scoreGrade
0F
60D
70C
80B
90A

In C2, fill down:

=IF(B2="","",XLOOKUP(--B2,$E$2:$E$6,$F$2:$F$6,"No tier",-1))

It returns the same A, A, B, B, C, blank, D, F. The -1 match mode takes an exact match or the next smaller threshold, so 87 becomes B. A score below 0 returns “No tier”.

XLOOKUP is in Microsoft 365, Excel 2021 and later, and Google Sheets, not in Excel 2019. There, =IF(B2="","",VLOOKUP(--B2,$E$2:$F$6,2,TRUE)) returned the same grades on this sample. The first column has to stay sorted ascending. If the B minimum moves from 80 to 82, you edit E5 instead of hunting through formulas. More on the lookup functions is in XLOOKUP vs INDEX MATCH vs VLOOKUP.

IFS itself is in Excel 2019, Excel 2021, Microsoft 365, and Google Sheets. On older Excel, a nested IF with the same --, blank check, and high-to-low order produced the same eight grades:

=IF(B2="","",IFERROR(IF(--B2>=90,"A",IF(--B2>=80,"B",IF(--B2>=70,"C",IF(--B2>=60,"D","F")))),"Check score"))
Oscar

表計算の数式とトラブル解決を紹介。検証環境と未確認事項は各記事を参照。

Google Sheets, 14 November 2026, tab ifs-wrong-result. Main IFS and nested IF in C2:C9 and D2:D9 returned A, A, B, B, C, blank, D, F. IFS without a default on 59 returned #N/A; TRUE,"F" and IFNA both returned F. Low-to-high order on 90 returned D; high-to-low returned A. Text-stored 72: ISNUMBER FALSE, ISTEXT TRUE, LEN 2, B6>=90 and B6>=1000 TRUE, unconverted IFS A, VALUE and -- both C. Blank B7: ISBLANK TRUE, B7<60 TRUE, --B7 0, unguarded IFS F, IF guard blank. Strict > on 90 returned B; >= on 80 returned B and on 60 returned D. =1/0 in a test with TRUE fallback returned #DIV/0!; IFERROR/ISERROR wrapper returned Check score, and Not A on 59. VALUE("absent") #VALUE!, main IFERROR formula Check score. XLOOKUP match mode -1 and VLOOKUP TRUE on E2:F6 returned the same eight grades; XLOOKUP of -1 returned No tier. Excel was not re-run.

次の記事:シートのエラーと動的配列 IMPORTRANGE の #REF!「You need to connect these sheets」を修正