VLOOKUP Concatenate Two Values: Master Helper Columns, CHOOSE, and XLOOKUP

VLOOKUP Concatenate Two Values: Master Helper Columns, CHOOSE, and XLOOKUP

Concatenating two values for VLOOKUP is a technique for combining multiple criteria, such as a product code and month, into a single combined key for an exact match. Helper columns are the most intuitive and fastest approach, and we will also cover the CHOOSE trick and XLOOKUP/FILTER alternatives.

Quick Fix — One-Line Helper Column Formula

=IFERROR(VLOOKUP($A2 & "-" & TEXT($B2,"yyyymm"), $F$2:$I$1000, 4, FALSE), "")

How It Works

Because VLOOKUP supports only one lookup key, you combine the criteria into text and look them up as a single key.

Practical Example 1: Helper Column

=[@상품코드] & "-" & TEXT([@월],"yyyymm")
=IFERROR(VLOOKUP($A2 & "-" & TEXT($B2,"yyyymm"), $F$2:$I$1000, 4, FALSE), "")

Practical Example 2: CHOOSE Trick

=IFERROR(VLOOKUP($A2 & "-" & TEXT($B2,"yyyymm"),
CHOOSE({1,2}, $F$2:$F$1000 & "-" & TEXT($G$2:$G$1000,"yyyymm"), $I$2:$I$1000), 2, FALSE), "")

Practical Example 3: Format-Safe Concatenation

=TRIM(CLEAN(UPPER([@상품코드]))) & "-" & TEXT([@월],"yyyymm")

Practical Example 4: XLOOKUP and FILTER

=IFERROR(XLOOKUP($A2 & "-" & TEXT($B2,"yyyymm"),
$F$2:$F$1000 & "-" & TEXT($G$2:$G$1000,"yyyymm"), $I$2:$I$1000, ""), "")
=FILTER($I$2:$I$1000, ($F$2:$F$1000=$A2)*(TEXT($G$2:$G$1000,"yyyymm")=TEXT($B$2,"yyyymm")), "")

Troubleshooting

IssueCauseSolution
#N/AFormat or spacing mismatchStandardize with TRIM/CLEAN/UPPER and TEXT()
Only September failsDigit count (1 vs. 01)Use TEXT(month,”00″) or a date in “yyyymm” format
Incorrect valueApproximate matchUse FALSE as the last argument
Slow performanceLarge CHOOSE arraysUse a helper column, reduce the range, or use a table

Related Articles


Reference: Microsoft Support — VLOOKUP, XLOOKUP

Leave a Reply

Your email address will not be published. Required fields are marked *