0

I have a table like this

Letter Selected letter Number
A B 1
B D 2
C 3
D 4

I'd like to have as a result:

Selected letter Number
B 1
D 4

I tried to compare the two firsts columns to retrieve the third one with no luck.

0

2 Answers 2

1

With the table of key-number pairs in columns A2:A and C2:C, you can look up the keys in column B2:B with this formula in cell D2:

=arrayformula( iferror( vlookup(B2:B, A2:C, columns(A2:C), false) ) )
3
  • For some reasons, I am only getting #error! when pasting this formula in my cells ; any idea what could go wrong ?
    – Dave Loepr
    Commented Jun 4 at 8:08
  • 1
    In the event your spreadsheet locale uses commas , as decimal separators, you will have to use semicolons ; as formula argument separators. In other words, replace all the commas in the formula with semicolons. See Set a spreadsheet’s location & calculation settings and Syntax differences in formulas by Ben Collins for more info. Commented Jun 4 at 9:01
  • Thank you, magic-like answer :)
    – Dave Loepr
    Commented Jun 4 at 11:27
1

FILTER function combined with COUNTIF will work

=FILTER({A2:A,C2:C},COUNTIF(B2:B,A2:A))
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.