HLOOKUP

水平查詢。橫向搜尋特定範圍中的第一列是否有指定準則,並將找到的資料欄中指定儲存格的值傳回。

使用範本

HLOOKUP(10003, A2:Z6, 2, FALSE)

語法

HLOOKUP(搜尋詞, 範圍, 索引, [已排序])

  • search_key 要尋找的值,舉例來說, -42 , , or I24.

  • 範圍 搜尋的指定範圍。The first row in the range is searched for the key specified in search_key.

  • 索引 - The row index of the value to be returned, where the first row in 範圍 is numbered 1.

    • IF 索引 is not between 1 and the number of rows in 範圍 , #VALUE! is returned.
  • 已排序 - [OPTIONAL - TRUE by default] - Indicates whether the row to be searched (the first row of the specified range) is sorted.

    • IF 已排序 is TRUE or omitted, the nearest match (less than or equal to the search key) is returned. If all values in the search row are greater than the search key, 無法使用 is returned.

    • IF 已排序 is set to TRUE or omitted, and the first row of the range is not in sorted order, an incorrect value might be returned.

    • IF 已排序 is FALSE, only an exact match is returned. IFthere are multiple matching values, the content of the cell corresponding to the first value found is returned, and 無法使用 is returned if no such value is found.

附註

  • When searching for numeric or date values, make sure that the first row in the range is not sorted by text values. 舉例來說,correctly sorted numbers should appear as (1, 2, 10, 100) rather than (1, 10, 100, 2) as they would be if they were sorted as strings. Using an incorrect sort type may cause incorrect values to be returned.

  • Search keys based on regular expressions or wildcard patterns are 不支援的功能Use QUERY instead.

  • HLOOKUP has much better performance with sorted ranges and 已排序 set to TRUE . Consider sorting the row being searched.

另請參閱

QUERY: 對多筆資料執行 Google Visualization API Query Language 查詢作業。

VLOOKUP: 垂直查詢。縱向搜尋特定範圍中的第一欄是否有指定準則,並將找到的資料列中指定儲存格的值傳回。

範例

在本範例中, HLOOKUP searches across the first row for a student ID and returns the corresponding grade.

在本範例中, HLOOKUP searches across the first row for the income using approximate match ( 已排序 is set to TRUE 以及returns the corresponding tax rate.

在本範例中, HLOOKUP returns the first value found when there are multiple matches for the search_key.

true
造訪學習中心

您有在公司或學校使用 Google 文件等 Google 產品嗎?快來試試實用的秘訣、教學課程和範本,瞭解如何在不安裝 Office 的情況下處理 Office 檔案、建立動態專案計劃和小組日曆、自動整理收件匣及進行其他作業。

搜尋
清除搜尋內容
關閉搜尋
主選單
11814628043747356785
true
搜尋說明中心
true
true
true
true
true
35
false
false