Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

concatenating a string and then executing the string statement using ="concatenated string"

I'm trying to create a string and then execute it. By this I mean, taking 'A' and '20' concatenating them and then getting the value of A20 in that cell.

Examples:

="A" & "20" -> doesn't work

=(CONCATENATE("A", "20")) -> doesn't work

Is there an execute function in excel? Example

=EXECUTE("string value")

so then I could create a string it would execute similar to if I typed =string value

like image 344
pandaEater Avatar asked Feb 17 '26 03:02

pandaEater


2 Answers

Not sure what you are trying to do - but if you are trying to get the value in cell A20 then you want to do this:

=INDIRECT((CONCATENATE("A", "20")),TRUE)

If you are trying to just concatenate those two strings then what you are doing is fine - and it shoudl work.

If you are trying to insert the string value of "A20" into a cell then you need to copy and paste special only values on your cell with your formula - this will convert your functions into simply their actual result values.

like image 123
Stepan1010 Avatar answered Feb 19 '26 05:02

Stepan1010


The 'Indirect' function is what you're looking for: =INDIRECT(CONCATENATE("A","20")) It returns the reference for a text string. Here is a good MSDN article about the function: http://support.microsoft.com/kb/151323

like image 31
Fink Avatar answered Feb 19 '26 05:02

Fink



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!