+ Reply to Thread
Results 1 to 3 of 3

Trouble referencing another sheet with INDIRECT function

Hybrid View

  1. #1
    Registered User
    Join Date
    05-23-2012
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    16

    Trouble referencing another sheet with INDIRECT function

    Hi everyone,

    I'm trying to set up a column of cells on a sheet which reference a cell in the exact same row of another sheet whenever a condition is met (e.g., on row 5 of Sheet 1, if Condition Y is met, the cell will display a result from row 5 of Sheet Y). There are multiple sheets to choose from, so I'm using an array with multiple conditions, which looks like this:

    =IF(INDIRECT(“S”&ROW())="XXX",INDIRECT("XXX!$C$"&ROW()),IF(INDIRECT(“S”&ROW())="XXY",INDIRECT("XXY!$C$"&ROW()),IF(INDIRECT(“S”&ROW())="XYY",INDIRECT("XYY!$C$"&ROW()), etc.
    So basically it chooses the sheet based on the contents of another cell in the same row and then cites cell C from the same row on the selected sheet. It seems good in theory, and if I just type out one of the IF conditions on its own, it works perfectly fine, but as soon as I plug these values into the array it goes haywire and I get a #NAME? error. I have no idea why this is happening. The IF array itself is apparently fine, as I'm using an identical one with different true values in another cell and it functions perfectly, but it just doesn't seem to want to accept these INDIRECT references to the other sheets for some reason.

    There aren't any spaces in the sheet names, so I don't need the single quotation marks around them. (I tried adding them to no avail.)

    I don't know what the problem is and I'd very much appreciate any help.

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,156

    Re: Trouble referencing another sheet with INDIRECT function

    hi No Surprises,

    would u mind uploading an eg? from what i see, if u are referencing from another worksheet, it should have a "Sheet1!" for eg.

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,366

    Re: Trouble referencing another sheet with INDIRECT function

    look at the quotation marks..
    eg.. yours

    INDIRECT(S&ROW())
    I think people forget the word "THANK YOU!!!!" Do you still know it???

    There is a little star ( ADD REPUTATION ) below those person who helped you. Click it to say your "PRIVATE APPRECIATION TO THEIR EFFORT ON THEIR CONTRIBUTIONS "

    Regards,
    Vladimir

+ 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.6.0 RC 1