Useless Blogging

September 1, 2010

Awesomer Excel Trick

Filed under: Programming,Work — steegness @ 9:47 am

OK, so the formula that I last posted apparently required a little work. It became immediately obvious that the use of the formula for a named range failed if the matching column was to the right of column Z; ther CHAR() function will only return one character. I needed to make the formula a bit more complex in order to handle that.

=OFFSET(INDIRECT(“Source!$” & IF(MATCH(“MatchingColumn”,Source!$1:$1, 0)>26, CHAR(64+TRUNC(MATCH(“MatchingColumn”,Source!$1:$1, 0)/26)) & CHAR(64+MOD(MATCH(“MatchingColumn”,Source!$1:$1, 0), 26)), CHAR(64+MATCH(“MatchingColumn”,Source!$1:$1, 0))) & “$2”), 0, 0, COUNTA(Source!$A:$A)-1,1)

Go to town!

Comments are closed.