Build formula based off value in another Cell

PeterWilson80

New Member
Joined
Oct 14, 2019
Messages
2
I am trying to get a formula to build based off a row reference i put into another

I have tried to put a simplified example of what i mean below

E2 is calculated using the formula shown in F2 as an example

So i have 4 columns of data, A - D, and i want to, for the example, minus the fig in D2 from A2, but what i want to do is have the Column Letter pulled from the Cells E1 & F1, so if i changed those entries it changes the formula, so if i wanted to minus the fig in B2 from A2 i would change the D in cell F1 to a B.

Not sure if this is possible or how to do it.
ABCDEF
1AD
2102455=A2-D2

<tbody>
</tbody>







 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
You could use =INDIRECT(E1&"2")-INDIRECT("F1"&2)

Which is volatile, or you could use
=INDEX($A2:$D2,1, Match(E1,{"A","B","C","D"},0)) - INDEX($A$2:$D2, 1, FIND(F1,"ABCD"))
which is non volatile and uses two different methods of finding the column reference.
 
Last edited:
Upvote 0
Hi & welcome to MrExcel.
How abot
=INDIRECT($E$1&ROW(A2))-INDIRECT($F$1&ROW(A2))
 
Upvote 0
I managed to get your example of =INDIRECT(E1&"2")-INDIRECT("F1"&2) and adjust it to what i required.

Thank you to both for the amazingly fast responses. Incredible

:)
 
Upvote 0
Glad we could help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,213,532
Messages
6,114,176
Members
448,554
Latest member
Gleisner2

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