View Single Post
  #5   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
vezerid vezerid is offline
external usenet poster
 
Posts: 751
Default How to replace a function with its resulting reference in a formula?

Having read the thread, it is obvious that you will need VBA, at least
for part of the problem, that is to break the formula into the
individual component HLOOKUP()'s. If all the formulas are sums of 2
HLOOKUP()'s, your job is somewhat easier, because you can write a UDF
to isolate the two parts and then populate two helper columns w/ these
formulas.

Once you have the components separately, you can then resort back to
formula programming. When you know the *result* of a lookup function
you can find the column (i.e. the position in an array) with
INDEX(MATCH(...)) or similar constructs. But given that columns grow
alphabetically instead of numerically, you might need to play with R1C1
reference style.

Overall it is rather complicated. Write if you need pointers to any of
the steps.