Excel_必學函數_VLOOKUP_深入教學
LHB阿好伯, Jan 26, 2019 10:05 PM
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
前言
VLOOKUP可以說是EXCEL中一個非常經典的函數
在學習EXCEL的過程中一定會學習到
網路上的教學也是非常多了
但我今天以一個較特別的方式來講解VLOOKUP的基礎
本文
說明部分擷取微軟的官方文件
http://bit.ly/2SQOwiu
VLOOKUP 語法需要四項資訊:
您想要查閱的值,也稱為「查閱值」。
查閱值所在的範圍。請記住,查閱值必須一律位於範圍的第一欄內
VLOOKUP 才能正確運作
例如,如果您的查閱值是位於儲存格 C2 中
您的範圍便應該從 C 開始
範圍中包含傳回值的欄號
例如,如果您將範圍指定為 B2:D11,您應該將 B 視為第一欄,C 視為第二欄,依此類推。
此外,如果您想要取得大約符合回傳值,可以指定 TRUE,
如果想要取得完全符合回傳值,可以指定 FALSE。
若您不指定,預設值一律為 TRUE 或稱為大約符合值。
現在將上述內容組合在一起:
=VLOOKUP(查閱值, 包含查閱值的範圍, 範圍中包含傳回值的欄號, 可選擇針對大約符合指定 TRUE 或針對完全符合指定 FALSE)
簡單說VLOOKUP就是依據要查詢的值
查尋表格範圍內首欄的資料回傳所需欄位的對應值
▼下面是一個範例希望可以幫助大家了解
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
他也有一個與他正好相反的函數HLOOKUP
查尋表格範圍內首列的資料回傳特定列的對應值
▼大致上差異像下方範例
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
在使用VLOOKUP時可能會遇到沒有對應數值的時候
▼這時會回傳#N/A的錯誤
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
▼這時候可以使用=IFERROR(檢查對象, 對象錯誤時的處理方式)
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
然後最後一個參數在使用過程中也要注意
一開始預設值一律為 TRUE 或稱為大約符合值
若要查詢確切完全符合的查詢值時,應改為 FALSE
▼若是沒有變更像是上面的範例也會有數值回傳
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
若是為FALSE的話就不會發生誤傳數值的問題
▼沒有就是沒有
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
但在模糊對照的時候也是有它的用處
例如你要知道列表中最後一列的資料
那可以給他一個極大的數值
例如EXCEL中可以使用的最大數值為9.99999999999999E+307
這表示VLOOKUP所能查詢的最大值
只要你的列表不是特殊情形都可以這數字來取得表單的最後一組資料
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
▼VLOOKUP在文字查詢也不是問題
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
可以搭配名稱定義與清單功能做到更多變化
▼例如一個簡單查詢系統介面
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
其中下拉式選單的製作最快速方法為定義好名稱
▼再利用資料驗證建立下拉式選單
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
第一列的名稱、中文成績等一樣可以製作成下拉式選單
但VLOOKUP的第三項參數要給他欄號無法餵文字給它
這時候就可以利用MATCH這函數來查詢對應的數字
MATCH(lookup_value, lookup_array, [match_type])
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
MATCH 函數語法具有下列引數:
lookup_value 必要。這是要在 lookup_array 中比對的值。
例如,當您在通訊錄中查閱某個人的號碼時,您是以那個人的姓名作為查閱值,但是電話號碼才是您要的值。
lookup_value 引數可以是一值 (數字、文字或邏輯值),也可以是數字、文字或邏輯值的儲存格參照
若想學習到更多函數推薦可以參考
本文章收錄至Office 技能樹
今天先分享到這邊希望大家都有收穫
網站所有文章皆為 H.B. Liu 撰寫,歡迎分享但勿轉製
也可以到粉專私訊我
喜歡我分享的內容也可以按讚追蹤一下我的粉專
幫我分享給所~~~有的朋友 \o/
有所錯誤歡迎指教