ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Can VLOOKUP return a formula?? (https://www.excelbanter.com/excel-worksheet-functions/239942-re-can-vlookup-return-formula.html)

Luke M

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!




All times are GMT +1. The time now is 01:54 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com