Site icon The Data are Alright

introducing: xlookup

Hi! Welcome to The Data Are Alright, a blog about tips and tricks for changemakers. According to my stats, most of you found your way here through Google. I hope you enjoy the post below. If you’d like to stick around, here are a couple of great options to read. You can even SUBSCRIBE, which would absolutely make my day! (I post approx 3x / month)

The xlookup formula made quite a splash when it hit the scene in Aug 2019 (729k views on the Microsoft Blog, many viral posts on spreadsheet Twitter) but it wasn’t until last week that I got up close and personal with the new kid on the grid, thanks to my spreadsheet soulmate who gave me a generous demo during co-working time.

The ideas here are really the result of Emily’s brilliance/hard work/chutzpah/growth mindset. Since I felt so inspired, we agreed that I could write them up!

Things are v-looking up…

… and I’m not just saying that bc I got my second COVID vax dose today! VLOOKUPs are one of my favorite and most handy spreadsheet formulas, truly a game changer. I use them every day in my work as a database manager because I’m always taking data from different spreadsheets and splicing them together. However, they also come in handy when I moonlight as a volunteer organizer.

Here’s an example of a perfect scenario for using a VLOOKUP.

The Zoning Board is making a decision on whether or not they will allow a new pop-up dog park to stay operating in Zip Code 10001. We want to email all the doggies in that zip code with a pup-date about the proceedings. We’re hoping to send them a personalized (doggie-alized) email with their first name to attract their attention. When we look through our data, we find one list that has First Name and Email (but no zip code) and one list that has Email and Zip Code (but no name). What’s an organizer to do?

If your answer is “forget the first name!” or “retype the data,” I have good news for you 🙂

This is where the VLOOKUP comes in handy! The VLOOKUP formula is an organizer’s best friend (besides your dog, of course). All you need to do is tell the VLOOKUP which column has the matching data (in this case, email is the overlapping column) and it will scan the column vertically (get it? that’s the V in Vlookup) until it finds a match. Then it will move over based on your criteria, find the data, and bring it back. VLOOKUP, go fetch!

As you can see, I asked my VLOOKUP formula to find “scruffy@dog.com” (aka the email in cell B2) in the list of emails in Column E. Once it finds a match, I asked it to go over 2 columns to find the zip code, and bring it back. Good job, here’s a treat!

This is a simple example – everyone’s emails follow the same format, there are only 3 dogs, and the tables happen to be in the same order. But in real life, we know that things get very complicated quickly!

VLOOKUP rules

See XLOOKUP in action!

XLOOKUPs are an improvement on some of the VLOOKUP’s shortcomings. Let’s see it in action!

This might not seem like a big deal, or it might not even look different to our unpeeled eyes. And that’s ok! I’m going to point out the big ole thing that changed so that we can get excited about it together. The “Email” column (our Common Column!) is on the RIGHT SIDE OF THE SECOND TABLE!!!!

Plus, the XLOOKUP lets us include a response for if the formula does not find a corresponding response (in this case, “no zip”). In VLOOKUP land, you need to handle the “N/A” situation differently… by wrapping your VLOOKUP formula inside of an “IF ERROR” formula, like a hug from a kind of awkward, distant family member.

But wait, there’s more!

XLOOKUP can do all sorts of fancy things that VLOOKUP and it’s less-common sibling formula HLOOKUP (Horizontal) can’t do. Here’s some highlights. (Learn more at this very interesting blog post!)

Do you think the XLOOKUP is too good to be true? Rest assured, there are a few limitations:

XLOOKUP in Google Sheets

Are you a Google Sheets lover? Cool, me too. You’re in the right place! There’s no such thing as “XLOOKUP” specifically in Google Sheets (yet), but Emily found a workaround that is JUST as good. Emily… is BRILLZ yall! They call this the “Imaginary Table” trick.

Spongebob cartoon with an imagination rainbow. Caption reads “Imagination is is Everything” in rainbow letters.

What’s this? Yes, it’s like the ultimate mashup of XLOOKUP and VLOOKUP, this time in Google Sheets.

Let’s breakdown the parts of the formula:

Et tu?

How are you using VLOOKUPs, HLOOKUPs, or XLOOKUPs? Leave me a comment on this post! I would loooooove to do a follow up post with some real, juicy social justice examples. Don’t be shy!

Exit mobile version