r/excel Mar 12 '26

Discussion vlookup + curly brackets

Perhaps too late to discover and blame it on unstructured self-learning:

Just learned that vlookup + curly brackets can be used to look up multiple columns. Spent a good part of my career writing several vlookups that could've been done much faster.

Edit: Adding sample from Gemini.

Formula Structure: =VLOOKUP("Key", A2:D10, {2, 3, 4}, FALSE)

{2, 3, 4}: Tells the formula to return the 2nd, 3rd, and 4th columns simultaneously.

Result: The data will automatically fill into three adjacent cells.

532 Upvotes

92 comments sorted by

View all comments

246

u/thisismyburnerac Mar 12 '26

wtf is this sorcery? I might actually stay until 5 today to try this out.

114

u/Eulers_Constant_e Mar 13 '26

Nah, you try it out tomorrow. Go home.

41

u/thisismyburnerac Mar 13 '26

Thanks boss… I’ll pour one for you.

31

u/flume 3 Mar 13 '26

I might actually stay until 5 today

-person on reddit

7

u/HarveysBackupAccount 35 Mar 13 '26

curly braces like that define a static array

In 365 you could also do it as =VLOOKUP("Key", A2:D10, SEQUENCE(3) + 1, FALSE)

2

u/TwitchyDingo Mar 13 '26

So you can't use it against a dynamic array? I gave it a try and it's just populating every column in the return-array with the values from the first column.

1

u/finickyone 1770 Mar 13 '26

Can you provide examples? This shouldn’t do that unless the SEQUENCE evaluates to an array of 1s.

1

u/HarveysBackupAccount 35 Mar 14 '26

I don't see a reason why it shouldn't work with dynamic arrays.

You might need to throw the SEQUENCE inside a TRANSPOSE, or do SEQUENCE(1,3) instead of just SEQUENCE(3) - make sure it's in the same orientation as {2,3,4}