earthworm
Well-known Member
- Joined
- May 19, 2009
- Messages
- 773
- Office Version
- 2019
- 2016
- Platform
- Windows
Re: June/July 2008 Challenge of the Month
i m laughing at the moment as soon as i start reading in the middle of paragraph i m lost . please elaborate in very very simple terms . i m not that hardcoder vba guy . suppose you want to make a calculation in paper how would you do it . what i m facing problem is my basic understanding of this formula is not clear . i even read the link which you posted , couldnt get a clue.
The formula you are referring to:
=LOOKUP(2^15,SEARCH(D$2:D$10,A2),E$2:E$10)
has the same structure as one often runs up against:
[1] LOOKUP(9.99999999999999E+307,MatchReference,ResultReference)
Reference stands for a vector like A2:A10 or an array like {1,#N/A,2,5,2}.
This expression returns the value from ResultReference that corresponds to the last numeric value in MatchReference. Note that:
[2] LOOKUP(9.99999999999999E+307,Reference)
always returns the last numeric value if one is available. How this works is explained in Post #7 at the following link:
http://www.mrexcel.com/forum/showthread.php?t=310278
Also, note that 9.99999999999999E+307 is a big constant mentioned in Excel's Help under "limits." So, 2^15 plays the same role, and in that sense, it's an unfortunate variation.
Back to [1]... The Search bit
SEARCH(D$2:D$10,A2)
yields an array reference of ten items, consisting of the #VALUE! errors and integer numbers. When a search value from D2:D10 is not in A2, we get a #VALUE! error, otherwise the start position of that search value in A2. When LOOKUP with the big number looks at this reference, it gets last position (integer) value and fetches the value that corresponds to it from E2:E10.
i m laughing at the moment as soon as i start reading in the middle of paragraph i m lost . please elaborate in very very simple terms . i m not that hardcoder vba guy . suppose you want to make a calculation in paper how would you do it . what i m facing problem is my basic understanding of this formula is not clear . i even read the link which you posted , couldnt get a clue.