Hi again Brajesh. Try the formula auditor in excel...it really helps to see what's going on with each of the components. Here's my interpretation of what's going on from the inner most to outer:
Substitutes "-" values in A2 of active sheet with each item in the array {"","-","/"," "}. If A2 contains TKO-147 the result would be TKO147,TKO-147,TKO/147,TKO 147.
Match below returns the row number where the values in the curly brackets (results of above) are found. Asterisks are used as wild cards so the array item can be found in any position of the searched text. Lets say that TKO/147 is found in row 3, then the results below would be {#N/A,3,#N/A,#N/A}
Lookup...a very useful and under-utilized function, has two ways to be used. In this case it's looking up a value in the array created by the match function above {#N/A,3,#N/A,#N/A} and returns the first result less than 2^20, which is the number of rows in Excel 2007 & 2010 (1,048,576 rows).
Index then looks at the result of LOOKUP, which is 3 and returns the value of the specified row of the range specified (Sheet2!B:B)
Then of course, if there were an error the function below would return "N/A".
Hope that helps...and hope you don't mind my explanation Haseeb! Thanks!
Bookmarks