Let(), Xlookup() & Offset()

Let(), Xlookup() & Offset()
Photo by Timothy Eberly / Unsplash

You need to pull a value (in this case, Hours) from a data dump for given Names. It is easy to do with an xlookup(), but the Hours are on another row from the Name. Instead of creating a Power Query and ending up with a table, you could copy/paste the text dump and use the offset() function.

The example below will pull the last name from the Name column and look for it in the data dump starting on row 12. If it finds it, then it will skip down two rows and pull the Hours.


=LET(
_name1, IFERROR(TRIM(MID(B5,1,FIND(",",B5)-1)), "not found"),
_name2, IF(_name1="not found", TRIM(B5), _name1),
OFFSET(XLOOKUP(_name2,C12:C29,F12:F29),2,0))


Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to Kessler Analytics Blog.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.