+ Reply to Thread
Results 1 to 4 of 4

Thread: Replacing the number in a cell reference

  1. #1
    Registered User
    Join Date
    06-14-2011
    Location
    Calgary, Canada
    MS-Off Ver
    Excel 2007
    Posts
    7

    Replacing the number in a cell reference

    Hi,

    I am looking to replace the number of a cell reference with a number indicated in another cell.

    Say that in A1 is "5" and in B1 is "=P8".
    How do I get the 8 in B1 replaced with whatever number is placed in A1 and give the value from P#?

    Thank you
    Last edited by ading; 06-14-2011 at 05:20 PM.

  2. #2
    Forum Guru JBeaucaire's Avatar
    Join Date
    03-21-2008
    Location
    Bakersfield, CA
    MS-Off Ver
    2010
    Posts
    19,208

    Re: Replacing the number in a cell reference

    Try this formula in B1:

    =INDIRECT("P" & A1)


    Another way without INDIRECT:

    =INDEX(P:P, A1)
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    “None of us is as good as all of us” - Ray Kroc
    “Actually, I *am* a rocket scientist.” - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    06-14-2011
    Location
    Calgary, Canada
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Replacing the number in a cell reference

    Works Great, Thank you so much.

  4. #4
    Forum Guru JBeaucaire's Avatar
    Join Date
    03-21-2008
    Location
    Bakersfield, CA
    MS-Off Ver
    2010
    Posts
    19,208

    Re: Replacing the number in a cell reference

    If that takes care of your need, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    “None of us is as good as all of us” - Ray Kroc
    “Actually, I *am* a rocket scientist.” - JB (little ones count!)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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.2.0