D
dmonder
I want to be able to enter a function in one cell as a text string and
be able to use that function in another cell.
For example, I would enter the string "%CELL% - MIN(%RANGE%)" into
B1. The cells B2 - B5 would replace the phrase %CELL% with their
respective cell value and %RANGE% with B2 through the last populated
cell.
I can get Excel to replace %CELL% and %RANGE% but I cannot get it to
execute the resulting string. I used SUBSTITUTE as follows:
=SUBSTITUTE(SUBSTITUTE($B$1,"%CELL%",ADDRESS(ROW(),COLUMN())),"%RANGE
%",ADDRESS(2,COLUMN())&":"&ADDRESS(2+COUNTA(A:A),COLUMN()))
I get this:
Function:,'Sheet 1'!%CELL% - MIN('Sheet 1'!%RANGE%)
Program 1,='Sheet 1'!$B$2 - MIN('Sheet 1'!$B$2:$B$5)
Program 2,='Sheet 1'!$B$3 - MIN('Sheet 1'!$B$2:$B$5)
Program 3,='Sheet 1'!$B$4 - MIN('Sheet 1'!$B$2:$B$5)
Program 4,='Sheet 1'!$B$5 - MIN('Sheet 1'!$B$2:$B$5)
They may look like formula's in B2 - B5 but they are text strings.
How can I now execute them?
David
be able to use that function in another cell.
For example, I would enter the string "%CELL% - MIN(%RANGE%)" into
B1. The cells B2 - B5 would replace the phrase %CELL% with their
respective cell value and %RANGE% with B2 through the last populated
cell.
I can get Excel to replace %CELL% and %RANGE% but I cannot get it to
execute the resulting string. I used SUBSTITUTE as follows:
=SUBSTITUTE(SUBSTITUTE($B$1,"%CELL%",ADDRESS(ROW(),COLUMN())),"%RANGE
%",ADDRESS(2,COLUMN())&":"&ADDRESS(2+COUNTA(A:A),COLUMN()))
I get this:
Function:,'Sheet 1'!%CELL% - MIN('Sheet 1'!%RANGE%)
Program 1,='Sheet 1'!$B$2 - MIN('Sheet 1'!$B$2:$B$5)
Program 2,='Sheet 1'!$B$3 - MIN('Sheet 1'!$B$2:$B$5)
Program 3,='Sheet 1'!$B$4 - MIN('Sheet 1'!$B$2:$B$5)
Program 4,='Sheet 1'!$B$5 - MIN('Sheet 1'!$B$2:$B$5)
They may look like formula's in B2 - B5 but they are text strings.
How can I now execute them?
David