Translating string to formula

boim

Board Regular
Joined
Dec 14, 2009
Messages
54
Suppose I have two columns Speed and Duration and they're defned with relative row absolute column in Names (i.e., Speed - "=$A2", Duration - "=$B2") .

On another range/sheet I define another Name: Distance that refers to a cell that contain a string: "Speed * Duration" (i.e., Distance - "=$AA$1, and cell AA1 contains the string "Speed * Duration").

I'd like to have a third column after Speed and Duration above that use the formula defined by the string pointed by Distance. Is it possible and what is the formula for the cells in the 3rd column in which I'd like to use the Distance formula? It seems possible but I can't figure out how. I'm trying to avoid event-based macro at this moment to keep things simple.

Note: The formula is defined in a string above so that in case the formula change (maybe to "Speed * 3 * Duration"), the result will be instantly reflected in the 3rd column.

Thanks.
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
You could make use of old Evaluate Call from a Name ?

Name: EVAL
RefersTo: =Evaluate(INDIRECT("RC[-1]",FALSE))

So if the cell to the left contains string: Speed * 3 * Duration

In adjacent cell to right:

=EVAL

should return the result (based on your names row position of the above formula would of course be important!)


Note if you were to use

=Evaluate(DISTANCE)

rather than earlier method and modified either Speed/Duration value you would need to use CTRL + ALT + F9 to have the above recalculate - the former method would not.
 
Upvote 0
Thanks that's what I've been looking for. Is Evaluate being phased out by Microsoft, I can't find it with auto-fill formula nor in help file with Excel 2007 except in the VBA section. I kind of vaguely remember that function in Excel 2003...
 
Upvote 0

Forum statistics

Threads
1,214,869
Messages
6,122,012
Members
449,060
Latest member
LinusJE

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