# その他の拡張関数

VLOOKUP関数は、シートの値を検索して、一致するレコードの値を検索できます。

{% hint style="info" %}
VLOOKUP関数はMashmatrix Sheetの数式で拡張追加されている関数です。Salesforceの入力規則で利用できるVLOOKUP関数との互換性はありません。
{% endhint %}

## **VLOOKUP(value, search\_column, result\_column)** <a href="#vlookup" id="vlookup"></a>

指定された値と一致するレコードを検索してそのレコードの値を返します。

| 引数名            | 説明              |
| -------------- | --------------- |
| value          | 一致検索する値         |
| search\_column | 一致検索する値を持つ列への参照 |
| result\_column | 返却する値を持つ列への参照   |

### 数式の例

```
/* シート"s1"の中で、"ProductId"列の値が現在のレコードのProductIdの値と一致するレコードを検索し、
   そのレコードの"ListPrice"列の値を返す */
VLOOKUP(CASESAFEID(ProductId), [s1].[#ProductId], [s1].[#ListPrice])

/* シート"s1"の中で、"Name"列の値が現在のレコードの"Name"列と"Type"列を結合した値と一致するレコードを検索し、
   そのレコードの"Amount"列の値を返す */
VLOOKUP([@Name] + " - " + [@Type], [s1].[#Name], [s1].[#Amount])
```

## VLOOKUP関数の制限および注意事項 <a href="#vlookup_function_limitations_and_notices" id="vlookup_function_limitations_and_notices"></a>

* VLOOKUP関数の検索対象は、そのシート上に取得されたレコードのみが対象となります。Salesforceのオブジェクトに格納されているレコード全体ではありません。シートの設定から「最大取得レコード数」を変更することにより、検索対象とするレコード数を増やすことが可能です。
* VLOOKUP関数の引数に渡す検索列および返却列には項目変数は指定できません。あるSalesforce項目を検索するには、一旦その項目を列としてシートに追加した後、その追加した列をVLOOKUP関数に渡す必要があります。
* VLOOKUP関数の引数に渡す検索列および返却列は、同一のシートに属する列である必要があります。
* ID型の項目変数を一致検索の値に指定する場合には、CASESAFEID関数を利用して18桁表記に統一する必要があります。


---

# Agent Instructions: 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:

```
GET https://docs.mashmatrix.com/mashmatrix-sheet/ja/functions_about_displaying_data/function/other_extension_functions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
