Skip to content

Instantly share code, notes, and snippets.

@rmeekers
Last active April 24, 2020 07:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rmeekers/3799fb5443729e10b6688d6ca28b2765 to your computer and use it in GitHub Desktop.
Save rmeekers/3799fb5443729e10b6688d6ca28b2765 to your computer and use it in GitHub Desktop.
Google Sheet formula to do a vlookup in multiple columns

Assumptions:

  • value to look for is in cell C2
  • array to search in: 'email domains'!A:Y
  • value to retrieve is in column no 26 (Z)
=ArrayFormula(if(countif('email domains'!A:Y;C2)=0;"";index('email domains'!A:Z;sum(if('email domains'!A:Y=C2;row('email domains'!A:Y))); sum(if('email domains'!A:Y=C2;26)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment