Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6744949
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:08:43+00:00 2026-05-26T12:08:43+00:00

I have a lookup which returns a formula as text, depending on the value

  • 0

I have a lookup which returns a formula as text, depending on the value of a particular cell.

The formula (as text) returned looks like this:

SUM(INDIRECT("AF"&row()),INDIRECT("AG"&row()))

I then use the EVALUATE() function to evaluate the formula, but receive a #REF error because of the use of INDIRECT().

This Microsoft Support Page was the only reference that I could find to this particular problem, and it doesn’t seem to offer an appropriate workaround.

How can I either: a) restructure the formula to avoid using INDIRECT, or b) get EVALUATE() to play nice?

EDIT

The lookup table looks something like this:

Type A                    SUM(INDIRECT(“AF”&row()),INDIRECT(“AG”&row()))
Type B                    SUM(INDIRECT(“AF”&row()),INDIRECT(“AG”&row()), INDIRECT(“AH”&Row()))

On another sheet, the contents of cells B1:200 are either Type A or Type B. A lookup returns the formula string based on the value of the cell and puts it into Bx. I then Evaluate the string to give me the result.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T12:08:43+00:00Added an answer on May 26, 2026 at 12:08 pm

    OK 3rd attempt at an answer:

    thanks for the example: it fails because you are trying to use INDIRECT to evaluate a named formula and INDIRECT only handles references not formulas.

    You need to use EVALUATE instead, but there is no built-in EVALUATE worksheet function (the EVALUATE you are using in the defined name is an ancient XLM Macro function).
    I suggest you use my EVAL VBA UDF instead

    Public Function EVAL(theInput As Variant) As Variant
    '
    ' if UDF evaluate the input string as though it was on this sheet
    ' else evaluate for activesheet
    '
    Dim vEval As Variant
    Application.Volatile
    On Error GoTo funcfail
    If not IsEmpty(theInput) then
    If TypeOf Application.Caller.Parent Is Worksheet Then
    vEval = Application.Caller.Parent.Evaluate(Cstr(theInput))
    Else
    vEval = Application.Evaluate(cstr(theInput))
    End If
    If IsError(vEval) Then
    EVAL = CVErr(xlErrValue)
    Else
    EVAL = vEval
    End If
    End If
    Exit Function
    funcfail:
    EVAL = CVErr(xlErrNA)
    End Function
    

    and then use defined names with relative references like typeA=SUM(Sheet3!RC1,Sheet3RC2).

    There are some “quirks” of EVALUATE that you should be aware of: see
    http://www.decisionmodels.com/calcsecretsh.htm

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I have a lookup table which I'd like to make accessible to
I'm trying to create an EJB factory class, which works like this: You have
I have the following submit handler which should lookup for some value based on
I have a Dictionary called AvailableBoxes. I want to lookup a string in this
I have a table tblInvestigators which contains a lookup field to display a list
Ok I have been trying every which way to figure this out. I need
I have a C++ function which returns a multi-line std::string . In the test-case
I have a specialprice lookup window in my silverlight project which is bound to
I have many tables that use Lookup/Enum references for most of their column values.
I have a DataGridViewComboBoxColumn in a DataGridView that's based on a lookup table. The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.