Display Formula instead of Result

aabbasi

Board Regular
Joined
Mar 4, 2002
Messages
188
Is there a way to display Formula's instead of Result on Excel Sheet. I want to use this function to train people how the calculation is performed on a particular sheet. I have about 20 different formulas used on this sheet.

Any help will be appreciated!
Thank you
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN

Dave Patton

Well-known Member
Joined
Feb 15, 2002
Messages
4,970
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
On 2002-09-13 06:37, aabbasi wrote:
Is there a way to display Formula's instead of Result on Excel Sheet. I want to use this function to train people how the calculation is performed on a particular sheet. I have about 20 different formulas used on this sheet.

Any help will be appreciated!
Thank you

I believe the shortcut to show formulas is
Ctrl+`. This may change the formatting on your sheet.

I use UDF (User Defined Function) GF (short for GetFormula)

Function GF(Rng As Range) As String
GF = Rng.Formula
End Function

Example =gf(A2) shows =Today()

or to document cells (including arrays)

formula is in A1
in another cell type A1
If the following UDF is in your file and it is assigned the shortcut Ctrl_Shift_F.

Using the function will format A1 and show
the complete formula that is in A1.

Sub FormulaDocumentation()
'
' Macro recorded 22/12/2001 by D.G. Patton
'
Dim Address1 As String
ActiveCell = UCase(ActiveCell)
Address1 = ActiveCell.Value
Selection.HorizontalAlignment = xlRight
If VarType(ActiveCell) = 0 Then
MsgBox "Did you select the cell with the formula's address?"
ElseIf Range(Address1).HasArray Then
ActiveCell.Offset(0, 1) = "{" & Range(Address1).Formula & "}"
ElseIf VarType(Address1) = 8 Then
ActiveCell.Offset(0, 1) = "'" & Range(Address1).Formula
Else
ActiveCell.Offset(0, 1) = Range(Address1).Formula
End If
End Sub

Assign to Ctrl-Shift-F
 

Forum statistics

Threads
1,144,050
Messages
5,722,229
Members
422,417
Latest member
Johhny

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top