excel-lookup-two-conditions
Use when you need to retrieve data from a table using two simultaneous conditions (e.g., row label + column header). Covers INDEX&MATCH, XLOOKUP&MATCH, VLOOKUP&MATCH, and HLOOKUP&MATCH patterns in Excel.
- License 许可
- MIT
- 最近更新
- 2026-10-02
- Stars
- ★ 93
- Forks
- 8
01 前言 Front Matter
- name
- excel-lookup-two-conditions
- description
- Use when you need to retrieve data from a table using two simultaneous conditions (e.g., row label + column header). Covers INDEX&MATCH, XLOOKUP&MATCH, VLOOKUP&MATCH, and HLOOKUP&MATCH patterns in Excel.
03 SKILL.md 正文
Two-Condition Lookups in Excel
When data is organized in a 2D table (rows = one dimension, columns = another), you need to match both a row key and a column key to extract a value.
INDEX & MATCH (most flexible, works in all Excel versions)
=INDEX(data_range, MATCH(row_key, row_headers, 0), MATCH(col_key, col_headers, 0))
Example: Retrieve value where Series Code = D12 and Year = 2020:
=INDEX(Data!$E$21:$I$40, MATCH($D12, Data!$D$21:$D$40, 0), MATCH(H$10, Data!$E$20:$I$20, 0))
MATCH(row_key, ..., 0)— finds the row position of the series codeMATCH(col_key, ..., 0)— finds the column position of the yearINDEX(array, row, col)— returns the value at that intersection
Key tips:
- Lock the data array with
$on both row and column ($E$21:$I$40) - Lock the row-key column reference (
$D12) so it doesn't shift horizontally when copying across columns - Lock the col-key row reference (
H$10) so it doesn't shift vertically when copying down rows - Use
0as the third argument to MATCH for exact matching
XLOOKUP & MATCH (Excel 365 / 2021+)
=XLOOKUP(row_key, row_key_range, XLOOKUP(col_key, col_key_range, data_array))
Or with MATCH:
=XLOOKUP(row_key, row_key_range, INDEX(data_array, 0, MATCH(col_key, col_headers, 0)))
VLOOKUP & MATCH
=VLOOKUP(row_key, lookup_table, MATCH(col_key, col_headers, 0), 0)
MATCHdynamically returns the column number for VLOOKUPlookup_tablemust start from the row_key column- Less flexible than INDEX&MATCH because it can only look right
HLOOKUP & MATCH
=HLOOKUP(col_key, lookup_table, MATCH(row_key, row_keys, 0), 0)
lookup_tablemust start from the col_key rowMATCHreturns the row number dynamically
Copying Formulas Across Ranges
When filling a rectangular range like H12:L17:
- The row condition (series code) is in a column (e.g., D12) → lock the column:
$D12 - The column condition (year) is in a row (e.g., H10) → lock the row:
H$10 - This allows the formula to be dragged both right and down correctly
04 同仓库更多 Skills
object_counter
Count occurrences of an object in the image using computer vision algorithm.
travel-planning-workflow
Invoke this skill when performing travel planning. It defines a structured workflow for generating itineraries. Following this workflow is essential to ensure the final plan satisfies user requirements.
bundled-dataset-search-tool
invoke this skill when you need to perform database search for travel planning. This skill provides some useful pre-packaged tools to look up accommodations, attractions, cities, driving distance, flights, and restaurants from the bundled dataset.
glm-output
Output-processing guidance for GLM tasks. Especially useful after glm-basics and glm-calibration when you need verifier-matching metrics from output.nc and a final /root/metrics.json.
glm-calibration
Calibration guidance for GLM tasks. Often most effective after glm-basics has clarified the setup; glm-output is the companion skill for exact final metric computation.
glm-basics
A good starting point for GLM calibration tasks. Use to inspect glm3.nml, confirm how GLM runs, and identify the relevant files before moving on to calibration and output evaluation.