+ Reply to Thread
Results 1 to 9 of 9

convert text input to cell reference

  1. #1
    Registered User
    Join Date
    03-26-2015
    Location
    Suriname
    MS-Off Ver
    microsoft office professional plus 2013
    Posts
    2

    convert text input to cell reference

    Hi everyone,

    for a project, I have to insert names of cells into excel. these cells, specified by me, should then be used for further calculations. So for example in cell A1, I have the tekst J4. I would like it to show on cell B1 as $J$4, so that I can use the real cell J4 in further calculations. What functions should I use?

    Capture.JPG

    Thank you
    Attached Images Attached Images

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: convert text input to cell reference

    You can use the INDIRECT function..

    =INDIRECT(A1)

    That will refer to the actual cell specified in A1

  3. #3
    Registered User
    Join Date
    03-26-2015
    Location
    Suriname
    MS-Off Ver
    microsoft office professional plus 2013
    Posts
    2

    Re: convert text input to cell reference

    Indirect returns the value of the cell and not the address of the cell.

    So if I do Indirect(A2), and A2 contains text "J4" then indirect returns the value of cell J4 and not the cell address $J$4

  4. #4
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: convert text input to cell reference

    You said that's your ultimate goal.
    Quote Originally Posted by kimfungloy View Post
    so that I can use the real cell J4 in further calculations.
    My suggestion bypasses the unnecessary step of converting J4 to $J$4, and just uses the real cell J4.

  5. #5
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: convert text input to cell reference

    If I am interpreting correctly you wish to build those addresses in column B referencing what is in column A? Try this in column B.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Edit:
    That only works if referencing cell address with one letter. Otherwise use this.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Another edit:

    Build your formula in column C …… just as an example “=B2&"+"&5”.

    This will not evaluate by itself. In this case you will need to use an old Excel 4.0 macro function called EVALUATE. You cannot use this in the spreadsheet. You must use Name Manager to build a formula.

    With D2 selected go to Name Manager and build this formula. I called mine “eval”. In the refers to box type this
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Then in D2 type =eval and hit Enter.
    There are some down sides. Excel will prompt you to save as a Macro-enabled file. Also, whenever you change values in J4, K4, P5 or S2 you will need to recalculate the workbook. To do this ……. while pressing and holding CTRL + ALT hit the F9 function key.

    File is attached.
    Attached Files Attached Files
    Last edited by FlameRetired; 03-26-2015 at 01:06 PM.

  6. #6
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: convert text input to cell reference

    And I get the same result using just
    =INDIRECT(A2)
    Bypassing all the extra steps.

    I don't understand the purpose of converting J4 to $J$4

    The $'s are completely unnecessary for this task.

    Indirect.xlsm

  7. #7
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: convert text input to cell reference

    Quote Originally Posted by Jonmo1 View Post
    And I get the same result using just
    =INDIRECT(A2)
    Bypassing all the extra steps.

    I don't understand the purpose of converting J4 to $J$4

    The $'s are completely unnecessary for this task.

    Attachment 385705
    Me neither....unless I've completely missed the point.

  8. #8
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: convert text input to cell reference

    Quote Originally Posted by FlameRetired View Post
    Me neither....unless I've completely missed the point.
    Pretty sure we're not getting the whole story
    Quote Originally Posted by kimfungloy View Post
    these cells, specified by me, should then be used for further calculations.
    It would help if the OP could elaborate on what he/she is planning on actually doing with these references once they're created.

    You can use indirect in larger formulas like
    =SUM(INDIRECT(A1):INDIRECT(B1))

    If A1 contains the text string J4 and B1 contains text string K5
    Then this would be the equivelent of
    =SUM(J4:K5)

  9. #9
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: convert text input to cell reference

    Quote Originally Posted by Jonmo1 View Post
    Pretty sure we're not getting the whole story


    It would help if the OP could elaborate on what he/she is planning on actually doing with these references once they're created.
    Yes.....sounds like there is more than one request here.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 2
    Last Post: 10-08-2012, 08:10 AM
  2. Convert text address to cell reference address
    By shaod in forum Excel General
    Replies: 1
    Last Post: 12-23-2011, 01:37 AM
  3. Convert cell reference to text string
    By packe in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 02-08-2007, 09:56 AM
  4. Code to convert text input to a number
    By FCC in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-07-2006, 05:00 AM
  5. [SOLVED] how do I convert text string into a cell reference
    By Dave Davis in forum Excel General
    Replies: 2
    Last Post: 07-22-2005, 05:05 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1