# Explain the 2^15 used in LOOKUP to find last cell containing a specific value

1. ## Explain the 2^15 used in LOOKUP to find last cell containing a specific value

=LOOKUP(2^15,SEARCH('1'!\$A\$2:\$A\$995,K2),'1'!\$B\$2:\$B\$995)

Can any one give me a clue was to what the purpose of 2^15 is in this lookup formula?
Obviously I know that from searching or clicking in the formula it is the lookup value but why could this number be so high. Obviously I don't understand the methodology behind this lookup. I don't see what this couldn't be 1 or 25... just as easy as 32768.

Can someone help me with this???

2. ## Re: Any LOOKUP Experts?

SEARCH searches for the value K2 in all of the cells in the range 1'!\$A\$2:\$A\$995. It returns the position number of the start of that value (if found)........ and the largest number of characters allowed in a cell is 32767 or 2^15-1

Having a lookup value of 2^15 therefore guarantees that that value will be larger than anything that SEARCH returns, this means that you get a match with the last cell that contains K2

3. ## Re: Any LOOKUP Experts?

That was part of my inclination. Thanks for the help!

4. ## Re: Any LOOKUP Experts?

Having a lookup value of 2^15 therefore guarantees that that value will be larger than anything that SEARCH returns, this means that you get a match with the last cell that contains K2
Doesn't it rather return a match to the cell in the result array which contains the search term furthest to the right within the string being searched? This is what would be represented as the largest value within the result array of the SEARCH function. LOOKUP then returns the largest value when no result is as big as the value you were looking up.

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1