Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Formula as text in cell

Hello

Is it possible to do a lookup on a table containing formulae and apply the
derived formula.

The table of formulae may contain for example the following values

A sum(a1:a2)
B sum(b1:b2)
C sum(c1:c2)

I cannot use nested IF statements as the actual formulae used by me are long
and extend over 1024 charaters.

Could anyone please provide me some way to achieve this?

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,520
Default Formula as text in cell

If the cell contents are not formulas but ranges as below then you can use
INDIRECT()

A1 a1:a2
B1 b1:b2
C1 c1:c2

=SUM(INDIRECT(A1))
is same as SUM(a1:a2)

If this post helps click Yes
---------------
Jacob Skaria


"Akhare" wrote:

Hello

Is it possible to do a lookup on a table containing formulae and apply the
derived formula.

The table of formulae may contain for example the following values

A sum(a1:a2)
B sum(b1:b2)
C sum(c1:c2)

I cannot use nested IF statements as the actual formulae used by me are long
and extend over 1024 charaters.

Could anyone please provide me some way to achieve this?

Thanks

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,059
Default Formula as text in cell

"Akhare" wrote:
Is it possible to do a lookup on a table containing formulae and
apply the derived formula.


Does one of the following ideas help?

1. Instead of a table of formulas in text form, have a table of formulas,
all of which are evaluated. Simply select the result using a lookup
function or CHOOSE. For example:

X1: =if(A1=B1,1,2)
X2: =if(A2=B2,3,4)
C1: =if(and(1<=C2,C2<=2),choose(C2,X1,X2),"")

Of course, that example could be done more simply. It is only a
paradigm for more complex formulas.


2. Set up X1:X2 as a table of formulas in text form (like the above, but
without "="), and define a named formula ("doit") as follows (Insert Name
Define Refers To):


=if(and(1<=$C$2,$C$2<=2),choose($C$2,$X$1,$X$2),"" )

Then in C1, you can put:

=doit

Caveat: Oddly, the named formula does not seem to be volatile.
Consequently, I need to press ctrl+alt+F9 every time a change occurs that
would affect the outcome of the named formula :(. Perhaps you or someone
else can find a work-around. Mine is #3 below.


3. Similar to #2, but instead of a named formula, define a UDF as follows:

Function doit(fml As String)
Application.Volatile
doit = Evaluate(fml)
End Function


----- original message -----

"Akhare" wrote in message
...
Hello

Is it possible to do a lookup on a table containing formulae and apply the
derived formula.

The table of formulae may contain for example the following values

A sum(a1:a2)
B sum(b1:b2)
C sum(c1:c2)

I cannot use nested IF statements as the actual formulae used by me are
long
and extend over 1024 charaters.

Could anyone please provide me some way to achieve this?

Thanks


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,059
Default Formula as text in cell

Errata....

I wrote;
2. Set up X1:X2 as a table of formulas in text form (like the above, but
without "="), and define a named formula ("doit") as follows (Insert
Name Define Refers To):

=if(and(1<=$C$2,$C$2<=2),choose($C$2,$X$1,$X$2),"" )


The named formula should be:

=if(and(1<=$C$2,$C$2<=2),evaluate(choose($C$2,$X$1 ,$X$2)),"")


Also....

I neglected to mention that generally I prefer #1 over any solution that
utilizes formulas in text form. The problem with the latter is that cell
references in the table of formula will not be updated automagically if you
insert rows or columns or move referenced cells.


----- original message -----

"JoeU2004" wrote in message
...
"Akhare" wrote:
Is it possible to do a lookup on a table containing formulae and
apply the derived formula.


Does one of the following ideas help?

1. Instead of a table of formulas in text form, have a table of formulas,
all of which are evaluated. Simply select the result using a lookup
function or CHOOSE. For example:

X1: =if(A1=B1,1,2)
X2: =if(A2=B2,3,4)
C1: =if(and(1<=C2,C2<=2),choose(C2,X1,X2),"")

Of course, that example could be done more simply. It is only a
paradigm for more complex formulas.


2. Set up X1:X2 as a table of formulas in text form (like the above, but
without "="), and define a named formula ("doit") as follows (Insert
Name
Define Refers To):


=if(and(1<=$C$2,$C$2<=2),choose($C$2,$X$1,$X$2),"" )

Then in C1, you can put:

=doit

Caveat: Oddly, the named formula does not seem to be volatile.
Consequently, I need to press ctrl+alt+F9 every time a change occurs that
would affect the outcome of the named formula :(. Perhaps you or someone
else can find a work-around. Mine is #3 below.


3. Similar to #2, but instead of a named formula, define a UDF as follows:

Function doit(fml As String)
Application.Volatile
doit = Evaluate(fml)
End Function


----- original message -----

"Akhare" wrote in message
...
Hello

Is it possible to do a lookup on a table containing formulae and apply
the
derived formula.

The table of formulae may contain for example the following values

A sum(a1:a2)
B sum(b1:b2)
C sum(c1:c2)

I cannot use nested IF statements as the actual formulae used by me are
long
and extend over 1024 charaters.

Could anyone please provide me some way to achieve this?

Thanks



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
linking a text formatted cell to a formula cell lacy Excel Discussion (Misc queries) 1 May 22nd 09 03:19 PM
Concatenate text cell and formula cell result GoinCrazy Excel Worksheet Functions 4 November 26th 08 04:27 PM
Insert text from one cell into formula in another cell. Deserthawk99 Excel Discussion (Misc queries) 2 March 1st 08 05:02 PM
Excel Formula if cell is empty then no if text in cell then yes Kathy Excel Worksheet Functions 2 December 20th 06 05:24 PM
match cell text with text in formula Todd L. Excel Worksheet Functions 3 December 9th 04 08:11 PM


All times are GMT +1. The time now is 11:38 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"