> For the complete documentation index, see [llms.txt](https://manuals.i-reporter.jp/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://manuals.i-reporter.jp/create-a-form/prepare-the-formexcelfile/excelfunctions/countblank-function.md).

# COUNTBLANK関数について

### **COUNTBLANK関数の結合セルに対する処理の違い**

ExcelでCOUNTBLANK関数を使用した場合、結合セルを１つのセルとは見なさずに、範囲内の各セルを１つ１つ個別に扱って計算を行います。

【Excelの例】\
Excelでは結合状態に関わらず指定範囲内のセルを個別にカウントします。\
下記図では、25個のセルを結合して1つのセル（クラスター）としており、範囲内の各セルを1つ1つ個別に扱うため、結果は「100」になります。

<div align="left"><figure><img src="https://3237210363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fd8X0mqwp3tAAJZM8UeyH%2Fuploads%2Ffr8AalpD1NFJXSiWjkgw%2Fimage.png?alt=media&amp;token=8356052a-8222-4f69-8d41-f738c4da720f" alt="" width="563"><figcaption></figcaption></figure></div>

これに対して、i-Reporterでは、結合セルを１つのクラスターとみなして計算を行います。\
これにより、結合セルを含むCOUNTBLANK関数の計算結果はEXCELとi-Reporterとで違いが表れます。

【i-Reporterの例】\
下記図は、先ほどの【Excelの例】のExcelファイルを取込んで作成した帳票定義の例です。\
i-Reporterでは結合セルを１つのクラスターとみなしてカウントするため、結果は「4」になります。

<div align="left"><figure><img src="https://3237210363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fd8X0mqwp3tAAJZM8UeyH%2Fuploads%2Fr1ivwEwPfjwW3O6IexKd%2Fimage.png?alt=media&amp;token=6ef9cb41-3463-4116-9637-ff065f5a8e82" alt="" width="563"><figcaption></figcaption></figure></div>

{% hint style="success" %}
i-Reporterで、結合セルを１つのクラスターとみなしてカウントするのは、COUNTBLANK関数のみの動きです。\
COUNTIF関数など他のCOUNT系関数は、Excelと同様に、範囲内の各セルを1つ1つ個別に扱います。

そのため、「空白クラスターの数を数えたい」場合は、COUNTBLANK関数をお使いください。\
COUNTIF関数などを使用した場合、正しい空白数を求めることができません。
{% endhint %}
