案例 18 運費級距查找:近似 VLOOKUP

應用情境

依計費重量查找適用的每公斤費率,再計算每票出貨運費。

開始表格 1:出貨資料

Shipment No.

Chargeable Weight

S001

80.00

S002

150.00

S003

260.00

S004

420.00

開始表格 2:運費級距表

Minimum Weight

Rate per KG

0.00

8.00

101.00

7.20

251.00

6.50

401.00

5.80

結果表格

Shipment No.

Chargeable Weight

Rate per KG

Freight Cost

S001

80.00

8.00

640.00

S002

150.00

7.20

1,080.00

S003

260.00

6.50

1,690.00

S004

420.00

5.80

2,436.00

Prompt

請使用 VLOOKUP 近似比對,依 Chargeable Weight 查找 Rate per KG,再乘以重量計算 Freight Cost;級距表必須由小到大排序。

Excel 公式範例

=VLOOKUP(B2,$E$2:$F$5,2,TRUE)*B2

Excel + AI 重點

Excel 近似比對適合運費、折扣與稅率級距;AI 可解釋近似比對邏輯、提醒級距排序,並協助處理低於最低級距或找不到資料的情況。

驗證重點

S003 的 260.00 公斤落在 251.00 起算級距,費率 6.50,因此運費為 1,690.00。級距表未遞增排序時,結果可能錯誤。

名詞說明

KG = Kilogram(公斤);VLOOKUP = Vertical Lookup(垂直查找),已於前面案例首次說明。