> 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/year-month-day-function.md).

# YEAR/MONTH/DAY関数について

## **YEAR/MONTH/DAY関数の使用制限**

YEAR/MONTH/DAY関数は、日付のシリアル値から、「年」 「月」 「日」をそれぞれ返す関数です。

{% hint style="success" %}
\=YEAR(日付)&#x20;

\=MONTH(日付)&#x20;

\=DAY(日付)&#x20;
{% endhint %}

引数に指定できる値は「シリアル値」のみです。引数が「シリアル値」以外の場合、計算結果は「数式エラー」となります。\
引数として指定できるクラスタ―種別は下記の通りです。

**【引数として指定可能なクラスター種別】**

* 年月日
* カレンダー年月日
* 計算式
* 帳票登録年月日（iOS版i-Reporterアプリのみ）
* 帳票更新年月日（iOS版i-Reporterアプリのみ）

{% hint style="warning" %}
**引数に「帳票登録年月日」「帳票更新年月日」を指定する場合の注意点**

Windows版i-Reporterアプリは「帳票登録年月日」「帳票更新年月日」に未対応です。\
例えば、「=YEAR(帳票登録年月日)」のような式をWindows版i-Reporterアプリで開くと、計算結果は「数式エラー」になります。
{% endhint %}

### **引数として計算式クラスタ―を指定する場合**

YEAR/MONTH/DAY関数の引数で、四則演算や別のExcel関数を使用することが可能です。\
ただし、引数に含む関数もすべてi-Reporterに対応しているExcel関数である必要があります。\
また、引数内で、IF(AND/OR)やIFERRORなどの数値以外も戻り値になる関数を使用する際、値が「シリアル値」以外の場合は「数式エラー」を返します。

### **計算結果（戻り値）**

YEAR/MONTH/DAY関数の計算結果（戻り値）は下記の通りです。

* YEAR関数：西暦。必ず4桁の数値
* MONTH関数：月。1～12の数値で、先頭に「0」は付きません
* DAY関数：日。1～31の数値で、先頭に「0」は付きません

### **i-Reporterアプリでの計算結果**

引数ごとの、i-Reporterアプリでの計算結果は下記の通りです。\
期待する計算結果が得られない場合は下記を参考に引数となる値を修正してください。

<table><thead><tr><th width="306">引数</th><th width="158">日付表示</th><th width="90">YEAR</th><th width="90">MONTH</th><th width="90">DAY</th></tr></thead><tbody><tr><td>「シリアル値」として有効な値<br><code>０</code>～<code>2958465</code></td><td>【例】2026/4/1</td><td>2026</td><td>4</td><td>1</td></tr><tr><td>「シリアル値」として無効な値<br>数値：<code>2958466</code>（年が5桁になる値）<br>文字列："ABC"、"2026/1/4" など</td><td>-</td><td>数式エラー</td><td>数式エラー</td><td>数式エラー</td></tr><tr><td>数値：<code>1</code></td><td>1899/12/31</td><td>1899</td><td>12</td><td>31</td></tr><tr><td>数値：<code>0</code></td><td>1899/12/30</td><td>1899</td><td>12</td><td>30</td></tr><tr><td>数値：<code>-1</code></td><td>-</td><td>数式エラー</td><td>数式エラー</td><td>数式エラー</td></tr><tr><td>真偽値：<code>true/false</code></td><td>-</td><td>数式エラー</td><td>数式エラー</td><td>数式エラー</td></tr><tr><td>空文字列：<code>””</code></td><td>-</td><td>空</td><td>空</td><td>空</td></tr><tr><td>空</td><td>-</td><td>空</td><td>空</td><td>空</td></tr></tbody></table>

{% hint style="success" %}

* 小数値が指定された場合は、小数点以下を切り捨てます。
* i-Reporterでは、引数が空（未入力状態）では数式エラーとはせず、結果を空にします。
  {% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://manuals.i-reporter.jp/create-a-form/prepare-the-formexcelfile/excelfunctions/year-month-day-function.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
