ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Reference function name from a different cell (https://www.excelbanter.com/excel-discussion-misc-queries/151510-reference-function-name-different-cell.html)

BryanDamon

Reference function name from a different cell
 
I am trying to do something like this
=A1(B1:B10)
where A1=sum (or some function)
So I want excel to know the text value in A1 as the function name. Is this
possible?



John Bundy

Reference function name from a different cell
 
If you can i've never heard/been able to. you can do it through code
something like this
Cells(1, 2) = "=" & Cells(1, 1).Text & "(B2:b5)"
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"BryanDamon" wrote:

I am trying to do something like this
=A1(B1:B10)
where A1=sum (or some function)
So I want excel to know the text value in A1 as the function name. Is this
possible?



BryanDamon

Reference function name from a different cell
 
Thanks, John,
Just to make sure I am doing this to make an array (so there is only one
equation that has different arguments/functions by referencing either
relative or absolute arguments for a thermodynamic add in to excel). Will
the array function still function properly when incorporated with VBA code?

"John Bundy" wrote:

If you can i've never heard/been able to. you can do it through code
something like this
Cells(1, 2) = "=" & Cells(1, 1).Text & "(B2:b5)"
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"BryanDamon" wrote:

I am trying to do something like this
=A1(B1:B10)
where A1=sum (or some function)
So I want excel to know the text value in A1 as the function name. Is this
possible?



Pete_UK

Reference function name from a different cell
 
There is an Evaluate function available in VBA which takes a string
that looks like an Excel formula (e.g. "=SUM(B1:B10)") and evaluates
it. This can easily be incorporated in a simple user-defined formula
(often called Eval - do a Google search for this), which would then
allow you to type:

=Eval(A1)

and if A1 contained the string the result will be the result of the
"string" formula.

Not exactly what you asked for, but it could easily be modified to
suit your situation.

Hope this helps.

Pete

On Jul 24, 7:32 pm, BryanDamon
wrote:
I am trying to do something like this
=A1(B1:B10)
where A1=sum (or some function)
So I want excel to know the text value in A1 as the function name. Is this
possible?




BryanDamon

Reference function name from a different cell
 
Thanks Pete!

"Pete_UK" wrote:

There is an Evaluate function available in VBA which takes a string
that looks like an Excel formula (e.g. "=SUM(B1:B10)") and evaluates
it. This can easily be incorporated in a simple user-defined formula
(often called Eval - do a Google search for this), which would then
allow you to type:

=Eval(A1)

and if A1 contained the string the result will be the result of the
"string" formula.

Not exactly what you asked for, but it could easily be modified to
suit your situation.

Hope this helps.

Pete

On Jul 24, 7:32 pm, BryanDamon
wrote:
I am trying to do something like this
=A1(B1:B10)
where A1=sum (or some function)
So I want excel to know the text value in A1 as the function name. Is this
possible?





Pete_UK

Reference function name from a different cell
 
You're welcome - glad to be of help.

Pete

On Jul 24, 10:44 pm, BryanDamon
wrote:
Thanks Pete!



"Pete_UK" wrote:
There is an Evaluate function available in VBA which takes a string
that looks like an Excel formula (e.g. "=SUM(B1:B10)") and evaluates
it. This can easily be incorporated in a simple user-defined formula
(often called Eval - do a Google search for this), which would then
allow you to type:


=Eval(A1)


and if A1 contained the string the result will be the result of the
"string" formula.


Not exactly what you asked for, but it could easily be modified to
suit your situation.


Hope this helps.


Pete


On Jul 24, 7:32 pm, BryanDamon
wrote:
I am trying to do something like this
=A1(B1:B10)
where A1=sum (or some function)
So I want excel to know the text value in A1 as the function name. Is this
possible?- Hide quoted text -


- Show quoted text -





All times are GMT +1. The time now is 08:18 PM.

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