Posted in Uncategorized, tagged indirect, iserror on June 27, 2008|
2 Comments »
This is a very interesting problem that we encountered.
To simplify the problem, the objective of the exercise was to insert spaces within a continuous list. For example
Column A has the original list and column D has the desired result. Two blank cells needed to be inserted between the entries.
To solve this problem, we made use of Indirect function.
Indirect is a lookup function that returns the reference specified by a text string. In the example above
Indirect(B1) returns “cherry” – cell B1 has A1 which contains cherry
and Indirect(B2) returns “microsoft” – cell B2 has A5 which contains microsoft
Here is an interesting variation:
Indirect(“B1”) returns A1 and Indirect(“B2”) returns A5
To solve the original problem
C1=1
C2=C1+1/3 (on dragging, this will insert two fractional numbers between the whole numbers)
D1=IF(ISERROR(INDIRECT(“A”&C1)),””,INDIRECT(“A”&C1))
The indirect function here takes the references as = indirect(“A1”)
You get the desired result when you drag the formulas
It works!
Read Full Post »