Focal Point
[SOLVED] Excel Formula - A Cell which displays Formula

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/9911095903

December 05, 2008, 01:48 PM
SauPa
[SOLVED] Excel Formula - A Cell which displays Formula
Code ( From a WebFocus Sample)

TABLE FILE SHORT
HEADING
"Projected Return Across Continent"
" "
SUM PROJECTED_RETURN AS 'RETURN' AND BALANCE AS 'BALANCE'
ACROSS CONTINENT AS 'CONTINENT'
BY REGION AS 'REGION'
ON CONTINENT ROW-TOTAL AS 'TOTAL'
ON TABLE COLUMN-TOTAL AS 'TOTAL'
ON TABLE SET STYLE *
TYPE=REPORT, COLOR=BLUE, BACKCOLOR=SILVER, SIZE=9,$
TYPE=HEADING, STYLE=BOLD, SIZE=14, $
TYPE=TITLE, STYLE=BOLD, SIZE=11,$
TYPE=SUBTOTAL,STYLE=BOLD, $
TYPE=GRANDTOTAL,STYLE=BOLD,SIZE=11,$
TYPE=ACROSSTITLE,STYLE=BOLD,SIZE=11,JUSTIFY=LEFT,$
TYPE=ACROSSVALUE,STYLE=BOLD,SIZE=10,JUSTIFY=CENTER,$
ENDSTYLE
ON TABLE PCHOLD FORMAT EXL2K FORMULA
END

Output -- Creates Columns H and I in the report which have the formula Cells.


Desired Output --
I want to modify this example to include another column J which should show the formula that adds the values in Column H + Column I.


Problem Statement -
While I can compute the sum of two values which in turn are the results of an Excel Formula.
I am not able to have the result displayed as a formula in Excel.
How Can I use Excel Functions such as Indirect ( that reference other cells)....

This message has been edited. Last edited by: Kerry,


Saurabh Palkar
December 06, 2008, 09:39 AM
<JG>
You have to use an Excel template/macro to do that.

Or simply compute another column that contains the formula as text.

COMPUTE FORMULA/A20='=(A1+D2)/X26';
December 06, 2008, 11:15 AM
FrankDutch
Saurabh

How can you be sure it's always column H and I you want to sum.

Why do you want this to be done with Excel?
What is the advantage?




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

December 16, 2008, 12:15 PM
SauPa
FrankDutch,

The advantage is in creation of calculators of certain logic.

I am creating a report that displays financial claims reports. A few initial values in the computation are obtained as is from the database. The rest are to displayed and done in Excel Formulae.

Our users would like to know the impact of changing certain values ( obtained from the database) on the net result.

Hence they not only want to sum up 2 columns that already contain other formula, but also want to that to be displayed.

So in the current example let us assume H and I as the columns the user would like to add.

Please note:- This example is only for purposes of discussion.

This message has been edited. Last edited by: SauPa,


Saurabh Palkar
December 17, 2008, 11:48 AM
SauPa
JG,
I think the idea to have the formula itself as a compute result is interesting.
But what about the references ? i.e. # for rows and columns....

In my case I want them add values of Column H, row aRow (say)....

How will I manipulate that ?


Saurabh Palkar