+ Reply to Thread
Results 1 to 10 of 10

Lookup Sheet name and return cell value in that sheet.

  1. #1
    Forum Contributor
    Join Date
    02-26-2014
    Location
    Aylsham, Norfolk, UK
    MS-Off Ver
    Excel 365
    Posts
    126

    Lookup Sheet name and return cell value in that sheet.

    Hi All,

    I have been looking for a few days now and can't seem to find a formula to works this one out.

    I have a macro enabled sheet and a formula which generates a list of sheets on the Main Sheet, beside that I reference data that I would like to return a value based on the sheet name.

    Column A contains all the Sheet Names, B the data I want it to return. For simplicity I have named the sheets by number.

    I would essentially like cell B# to look at the data in Cell A# of the Main Page and match that with the Sheet name, then return Cell B4 of that sheet.

    If an example is needed then I can extract a blank version of the document for reference.

    Thank you in advance

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Lookup Sheet name and return cell value in that sheet.

    Try this...
    =INDIRECT("'"&A2&"'!"&B2)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: Lookup Sheet name and return cell value in that sheet.

    try this where A1 is on your main sheet and has the name of the sheet and A2 is the cell reference on sheet2

    =INDIRECT(A1&"!A2")
    Happy with my advice? Click on the * reputation button below

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Lookup Sheet name and return cell value in that sheet.

    Crooza that will work fine as long as there are no spaces in the sheet name (OP said they numbered the sheets, so that should still work OK)

    If there are (or could be) spaces in the sheet name, then it is often better to include the ' ( "," ) to cater for that
    If there are no spaces, then including ' causes no problems

  5. #5
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: Lookup Sheet name and return cell value in that sheet.

    Yeah good point.

  6. #6
    Forum Contributor
    Join Date
    02-26-2014
    Location
    Aylsham, Norfolk, UK
    MS-Off Ver
    Excel 365
    Posts
    126

    Re: Lookup Sheet name and return cell value in that sheet.

    Hi guys, I tried to formula but it is returning a #REF error, I'm not sure if it makes a difference but the values being returned are text and not numbers, I'll post a blank version for reference to try an explain what it is that I need, also the cell that is producing the sheet name contains an array formula which might be confusing the formula.

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Lookup Sheet name and return cell value in that sheet.

    Sounds like this is what you want:

    =INDIRECT("'"&A2&"'!B4")

    Where A2 is the sheet name.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  8. #8
    Forum Contributor
    Join Date
    02-26-2014
    Location
    Aylsham, Norfolk, UK
    MS-Off Ver
    Excel 365
    Posts
    126

    Re: Lookup Sheet name and return cell value in that sheet.

    Tony, that is it, as simple matter of setting the "

    Thank you all for your assistance. Reputation on its way!
    Attached Files Attached Files

  9. #9
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Lookup Sheet name and return cell value in that sheet.

    Good deal. Thanks for the feedback!

  10. #10
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Lookup Sheet name and return cell value in that sheet.

    I thought you had the cell ref you wanted to use, in another cell, thats why I did not "" that part.

    But it's all good and Im happy you got this resolved - thanks for the feedback, too

+ 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. lookup for a cell value in entire sheet and return value from a column
    By atulkumar.goel in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-22-2014, 01:38 PM
  2. Search in sheet 1 and return to sheet 2 using LOOKUP?
    By ptk in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-07-2013, 05:08 AM
  3. Replies: 1
    Last Post: 11-07-2012, 01:57 PM
  4. Replies: 11
    Last Post: 10-14-2012, 01:03 PM
  5. Replies: 0
    Last Post: 01-18-2009, 06:11 PM
  6. lookup single value in one sheet, return multiple results from the other sheet
    By cvanoosbree in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 01-16-2009, 04:23 PM

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