How to place a cell formula after the formula result in the cell?

J

J.E. McGimpsey

If you don't intend on using the result in further calculations, you
can use:

J1: =SUM(A1:H17) & "=SUM(A1:H17)"

but this results in Text.
 
D

Dave Peterson

A manual way would be to type the formula a second time:

if the result of the formula is numeric:
=A1+A2 +0*N("a1+A2")
(spaces left for legibility only)

if the result of the formula is text:
=A1&A2 &TEXT(N("a1&a2"),"#")
 
D

Dmitriy Kopnichev

How to add the formula text to the right of its result automatically for
every cell with a formula? The formula text should be with the preceding
"=".
 
D

Dave Peterson

G

Gord Dibben

Looks like Dmitriy has given up on Ron's ShowAllInfo or the ListFormulas from
John W.<g>

Gord
 
R

Ron Rosenfeld

I want to see formulas with their results when I print.

Here's one way:

1. Enter a UDF (VBA routine)
<alt-F11> opens the VB Editor
Ensure your current project is highlighted in the Project Explorer
Insert/Module
Paste the code below into the window that opens:

Function ShowFormula(rg As Range) As String
ShowFormula = rg.Formula
End Function

2. You now have several methods of showing this formula:

Insert a column next to the column with your formula.
Assuming your formula is in Column C, place in Column D:

=C2 & ShowFormula(C2)

Copy down as needed.

For printing, hide column C.

You could also, in Column D, put the formula ShowFormula(C2) and print both
columns C & D.


--ron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top