OX_Gambit said:
What does the 1/(LEFT(A1:A7,4) do to the text?
....
Unless Transition Formula Evaluation is enabled (it's disabled by
default), Excel converts numbers to text when used in text contexts,
such as when ranges are processed by the LEFT function. LEFT(range,4)
returns an array of the leftmost 4 characters from each cell in range.
In your case that would mean returning the leftmost 4 numerals as a
string. The entire expression actually was
1/(LEFT(A1:A7,4)="1006")
in which the leftmost 4 numerals in each cell in A1:A7 is compared to
"1006", the 4 digits you've said you're seeking. The result is an
array of TRUE (match) or FALSE (don't match) values. Next, Excel
converts TRUE to 1 and FALSE to 0 when they're used in arithmetic
contexts such as dividing them into 1. The entire expression will then
return an array of 1s (1/TRUE = 1/1 = 1) or #DIV/0! (1/FALSE = 1/0 =
#DIV/0!). The rest of the formula uses a quirk of Excel LOOKUP
function in which it will seek through it's entire 2nd argument to
find the first value greater than its 1st argument. It also keeps
track of the last value in its 2nd argument less than its 1st
argument. Since the 2nd argument would contain only 1 and #DIV/0!, it
won't find 2. It skips the #DIV/0! values, and it keeps track of the
last 1 found. When it runs through the 2nd argument array without
finding a 2, it uses the last 1 found as the match. That means it
matches the last cell in A1:A7 that begins with the ordered numerals
1006.