Show cell value in formula instead of cell reference

Sufiyan97

Well-known Member
Joined
Apr 12, 2019
Messages
1,538
Office Version
  1. 365
  2. 2013
Platform
  1. Windows
Is it possible to show cell value instead of cell reference in a formula? expected results are in column D

Formula (1).xlsx
ABCD
1CompensationExpected
21294.23-52.21346.431346.43
31219.23-52.21271.431271.43
41219.23-52.21271.43
51301.86-52.21354.06
61219.23-52.21271.43
71305.67-52.21357.87
81219.23-53.661272.89
91212.16-53.661265.82
101240.76-53.661294.42
111223.5-53.661277.16
121219.23-53.661272.89
131219.23-53.661272.89
141232.43-53.661286.09
151219.23-53.661272.89
161231.73-53.661285.39
17973.99-53.661027.65
181099.87-53.661153.53
191268.63-53.661322.29
201033.58-53.661087.24
2122953.02903.4622049.56
22
Sheet2
Cell Formulas
RangeFormula
D2D2=1294.23+52.2
D3D3=1219.23+52.2
C2:C21C2=A2-B2


this might help by Fluff

 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Is this what you want?

Dante Amor
ABCD
1CompensationExpected
21294.23-52.21346.43=1294.23+52.2
31219.23-52.21271.43=1219.23+52.2
41219.23-52.21271.43=1219.23+52.2
51301.86-52.21354.06=1301.86+52.2
61219.23-52.21271.43=1219.23+52.2
71305.67-52.21357.87=1305.67+52.2
81219.23-53.661272.89=1219.23+53.66
91212.16-53.661265.82=1212.16+53.66
101240.76-53.661294.42=1240.76+53.66
111223.5-53.661277.16=1223.5+53.66
121219.23-53.661272.89=1219.23+53.66
131219.23-53.661272.89=1219.23+53.66
141232.43-53.661286.09=1232.43+53.66
151219.23-53.661272.89=1219.23+53.66
161231.73-53.661285.39=1231.73+53.66
17973.99-53.661027.65=973.99+53.66
181099.87-53.661153.53=1099.87+53.66
191268.63-53.661322.29=1268.63+53.66
201033.58-53.661087.24=1033.58+53.66
2122953.02903.4622049.56=22953.02-903.46
Hoja6
Cell Formulas
RangeFormula
C2:C21C2=A2-B2
D2:D21D2="="&A2&IF(B2<0,"+"&-B2,"-"&B2)
 
Last edited:
Upvote 0
Sorry @DanteAmor It is not, I want final result to show up in cell, while the result in your post in column D should show up in formula bar.

it should show cell value instead of cell reference.

Just look at column D expected results in my post.
 
Upvote 0
I'm not understanding.
Instead of a minisheet you could put an image to know what you want to see in the cell and what you want to see in the formula bar.

Since in the answer to which you refer, this is what I see in the cell (=6977835.66/1000) and in the formula bar there is a formula:

1685293235083.png


So in my response in the cell is observed (=1294.23+52.2 ) and in the formula bar a formula:

1685293374372.png


----------------------------------
That is why my confusion.

If you could put a picture, maybe it will be clearer for me.
 
Upvote 0
this might help by Fluff
I'm not sure why you have provided that link. It seems to me that you were effectively asking the same question in that thread as you are here and you marked Fluff's post as the solution yet it did not do what your expected result showed in that thread. Dante's formula here does the same thing as Fluff's formula in that other thread.

Is it possible to show cell value instead of cell reference in a formula? expected results are in column D
I am happy to be proved wrong but I don't believe that what you are asking is possible**

**That is unless you would be happy to have your existing formula in C2, manually go to the formula bar and select A2 in that formula and press F9 and then select B2 in the formula bar and press F9 again. In that case you would then see this in the formula bar

1685339386844.png


Note though that if you do this and then alter a value in A2 or B2 the formula in C2 will not update to reflect the new A2/B2 value(s)
 
Upvote 0
Hi @DanteAmor and @Peter_SSs I am sorry for the confusion,

Below is what I expecte as result, which Peter mentioned that need to do manually by pressing F9 in each cell, I want if there is any way to do it in one go.

Current formula in formula bar,

1685351326328.png



Expected Result in formula bar while keeping cells result same as current formula that is 1346.43, so basically it is to show cell value in formula bar instead of cell reference.

1685351378119.png


Thanks for both of your time and apologize for confusion.
 
Upvote 0
I don't know if it can be done with a formula but here is an option with a macro:
Change "D" on this line
With Range("D" & i)
By "C" or by the column where you want the result.

VBA Code:
Sub ExpectedResult()
  Dim i As Long
  For i = 2 To Range("A" & Rows.Count).End(3).Row
    With Range("D" & i)
      If Range("B" & i).Value < 0 Then
        .Formula = "=" & Range("A" & i).Value & "+" & -Range("B" & i).Value
      Else
        .Formula = "=" & Range("A" & i).Value & "-" & Range("B" & i).Value
      End If
    End With
  Next
End Sub
 
Upvote 0
Solution
Thank you very much Dante, That is it.

Thank you for your time and help.
 
Upvote 0
That is it.
I don't know anything about your data or reason for wanting to do this but remember that if the values in column A or B change, the formula won't automatically reflect the new value(s)
 
Upvote 0
I don't know anything about your data or reason for wanting to do this but remember that if the values in column A or B change, the formula won't automatically reflect the new value(s)

Yes Peter I know that, but I keep getting strange requests from colleagues and they get it from their clients.

Thanks for the comment.
 
Upvote 0

Forum statistics

Threads
1,215,372
Messages
6,124,535
Members
449,169
Latest member
mm424

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
Back
Top