K
Ken Mock
Looking for a way to vary the returned value column in a Vlook-up function. I
have a report that can be run for a various #of financial periods the Value
returned is the Sum of the Expansions. For each period where data exists you
get a column expansion between the lookup value and the returned Value. For
Example Look-up is column 1, returned Value could be in Column 2-10. I tried
using the =column()function to identify the column # in a seperate cell and
link the Vlook-up to that cell instead ofinserting a number, I also tried
nesting the function inside the V-look-up formula.
Original Formula
=IF(ISERROR(VLOOKUP(C12,C2526,13,FALSE))=TRUE,0,VLOOKUP(C12,C2526,13,FALSE))
Attempted:
=IF(ISERROR(VLOOKUP(C12,C2526,J$4,FALSE))=TRUE,0,VLOOKUP(C12,C2526,J$4,FALSE))
- where J$4 =Column() which did return the correct column # on expansion
because the cell is located to the right of columns inserted by the expansion
=IF(ISERROR(VLOOKUP(C12,C2526,(Value(J$4)),FALSE))=TRUE,0,VLOOKUP(C12,C2526,(Value(J$4)),FALSE))
=IF(ISERROR(VLOOKUP(C12,C2526,(column()),FALSE))=TRUE,0,VLOOKUP(C12,C2526,(column()),FALSE))
It happens that the formula is going on the same column being returned in
this Case
=IF(ISERROR(VLOOKUP(C12,C2526,(Value(column())),FALSE))=TRUE,0,VLOOKUP(C12,C2526,(Value(column())),FALSE))
all with no luck.
I know this can be done with a macro but I am trying to avoid this.
If anyone can help, I would appreciate it.
thanks
have a report that can be run for a various #of financial periods the Value
returned is the Sum of the Expansions. For each period where data exists you
get a column expansion between the lookup value and the returned Value. For
Example Look-up is column 1, returned Value could be in Column 2-10. I tried
using the =column()function to identify the column # in a seperate cell and
link the Vlook-up to that cell instead ofinserting a number, I also tried
nesting the function inside the V-look-up formula.
Original Formula
=IF(ISERROR(VLOOKUP(C12,C2526,13,FALSE))=TRUE,0,VLOOKUP(C12,C2526,13,FALSE))
Attempted:
=IF(ISERROR(VLOOKUP(C12,C2526,J$4,FALSE))=TRUE,0,VLOOKUP(C12,C2526,J$4,FALSE))
- where J$4 =Column() which did return the correct column # on expansion
because the cell is located to the right of columns inserted by the expansion
=IF(ISERROR(VLOOKUP(C12,C2526,(Value(J$4)),FALSE))=TRUE,0,VLOOKUP(C12,C2526,(Value(J$4)),FALSE))
=IF(ISERROR(VLOOKUP(C12,C2526,(column()),FALSE))=TRUE,0,VLOOKUP(C12,C2526,(column()),FALSE))
It happens that the formula is going on the same column being returned in
this Case
=IF(ISERROR(VLOOKUP(C12,C2526,(Value(column())),FALSE))=TRUE,0,VLOOKUP(C12,C2526,(Value(column())),FALSE))
all with no luck.
I know this can be done with a macro but I am trying to avoid this.
If anyone can help, I would appreciate it.
thanks