+ Reply to Thread
Results 1 to 4 of 4

Insert cell text as part of formula?

  1. #1
    Registered User
    Join Date
    06-02-2009
    Location
    d.cizzle
    MS-Off Ver
    Excel 2007
    Posts
    2

    Cool Insert cell text as part of formula?

    Hi all,

    Sorry if the answer to this is somewhere else, but I can't find it anywhere, so as you can see, I created an account for myself to ask this question.

    What I need to know is how to include another cell's text inside a formula. In my case, my main spreadsheet spreadsheet's first column contains country names (i.e., A1 is Australia, A2 is Austria, etc.). I also have multiple spreadsheets that I am referencing in formulas throughout my main spreadsheet, and those other referenced spreadsheets all have corresponding country names as titles. So, for example, one of the formulas in the Belgium row in my main spreadsheet is: =[Belgium.xls]Sheet1!$H$16

    But I need a more general way of expressing the "Belgium" part so that I don't have to tediously enter every correct country's name in each formula in my main spreadsheet. Since the first cell in the row with the formula referenced above contains "Belgium", I tried substituting the formula above with the following: =["A3"&.xls]Sheet1!$H$16

    This turned out to be a horrible failure. Any help on how to accurately fix my problem would be much appreciated. Thanks in advance.

  2. #2
    Forum Contributor starryknight64's Avatar
    Join Date
    09-27-2006
    Location
    Missouri
    MS-Off Ver
    2003 (Work) & 2007 (Home)
    Posts
    193

    Re: Insert cell text as part of formula?

    Try this out:

    Please Login or Register  to view this content.
    Just change row and col variables to where your links column starts.

    So, say the first element in your links column starts at K32.
    Please Login or Register  to view this content.
    starryknight64

  3. #3
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: Insert cell text as part of formula?

    Hi Elazarus, and welcome to the forum.

    You can use the INDIRECT function for this, for example:

    =INDIRECT("["&A3&".xls]Sheet1!$H$16")

    When copied down, only the A3 will change (to A4, A5, etc.). Hope that helps!

  4. #4
    Registered User
    Join Date
    06-02-2009
    Location
    d.cizzle
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Insert cell text as part of formula?

    Thanks to both of you...I used Paul's suggestion, but the VBA help is also useful because I'm trying to teach myself how to do macro programming and can never find good advice.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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