View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Luke M Luke M is offline
external usenet poster
 
Posts: 2,722
Default Can VLOOKUP return a formula??

You could, with a little help from VB. Open up the VBE (Alt+F11), goto Insert
- Module, and paste this in:

'==========
Function EvalFormula(FormulaCell As String)
EvalFormula = Evaluate(FormulaCell)
End Function
'==========

Now, back in your workbook, you can setup your VLOOKUP table, and then your
formula will be something like:

=EvalFormula(VLOOKUP(formulaGoesHere))

EvalFormula will treat whatever is returned from the VLOOKUP as if it's an
actual formula.

--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Iriemon" wrote:

Can a VLOOKUP return a formula rather than a value?

If not, is there any function that will return a formula?

I have a spreadsheet where depending on certain criteria, I need to use a
different formula. Unfortunately, I have 58 "rules" (criteria) I need to test
for to determine which formula to utilize. Right now I am performing
calculations for all 58 rules in a table on a separate worksheet and then
using a macro to bring in each part number, perform the calculations, do a
VLOOKUP and then return the correct result to the master worksheet. With
17,000 + rows, it is taking a bit of time to do.

Any suggestions on how to speed this up would be great!

Irie!