+ Reply to Thread
Results 1 to 6 of 6

Sheet Reference Formula Help

  1. #1
    Valued Forum Contributor
    Join Date
    05-08-2012
    Location
    Georgia, USA
    MS-Off Ver
    Excel 2003, 2010
    Posts
    811

    Sheet Reference Formula Help

    I have a formula below:

    =IFERROR(AVERAGEIF('02-09'!$E$2:$E$50,B4,'02-09'!$J$2:J50),"") that I would like to change

    In cell D3 of the current sheet I have a function that return the sheet name for a dependent sheet. For example:
    =sheetname('02-09'!$B$16) would return 02-09.

    Instead of referring to sheet 02-09 I would like the formula to be dynamic and reference D3 of the current sheet like

    =IFERROR(AVERAGEIF(D3&!$E$2:$E$50,B4, D3&$J$2:J50),"").

    What is the proper formula that I can use? Would INDIRECT work?

    I attached a copy of the spreadsheet
    Attached Files Attached Files
    Click on star (*) below if this helps

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

    Re: Sheet Reference Formula Help

    hi K m. yes INDIRECT would work.
    =IFERROR(AVERAGEIF(INDIRECT("'"&$D$3&"'!$E$2:$E$50"),B4,INDIRECT("'"&$D$3&"'!$J$2:$J$50")),"")

    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 Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Sheet Reference Formula Help

    Quote Originally Posted by benishiryo View Post
    hi K m. yes INDIRECT would work.
    =IFERROR(AVERAGEIF(INDIRECT("'"&$D$3&"'!$E$2:$E$50"),B4,INDIRECT("'"&$D$3&"'!$J$2:$J$50")),"")
    We'll need to add to this.
    The original formula had reference to $J$2:J50 <--notice lack of $'s on J50
    Indicating the formula is filled and expecting the J50 to incriment.

    the J50 will not incriment in the Indirect formula. (also no need for the $'s in the indirect text string)

    Try
    =IFERROR(AVERAGEIF(INDIRECT("'"&$D$3&"'!E2:E50"),B4,INDIRECT("'"&$D$3&"'!J2:"&CELL("ADDRESS",J50))),"")
    Last edited by Jonmo1; 04-10-2013 at 09:12 AM.

  4. #4
    Valued Forum Contributor
    Join Date
    05-08-2012
    Location
    Georgia, USA
    MS-Off Ver
    Excel 2003, 2010
    Posts
    811

    Re: Sheet Reference Formula Help

    Sorry, I couldn't get it to work.

    Here is my new formula

    IFERROR(AVERAGEIF('03-30'!$E$2:$E$150,$B4,'03-30'!$J$2:N50),"")

    I want to replace 03-30! with what is in cell H3 of this worksheet

    I have attached a sample file and highlighted in orange the cell in question
    Attached Files Attached Files

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

    Re: Sheet Reference Formula Help

    Try

    =IFERROR(AVERAGEIF(INDIRECT("'" & H$3 &"'!$E$2:$E$150"),$B4,INDIRECT("'" &H$3&"'!$J$2:"&CELL("address",N50))),"")

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

    Re: Sheet Reference Formula Help

    @Jonmo1:
    i was just lazy to remove the $ signs. and you did that too in post#5 for column E. as for the lack of dollar sign in J50, it is supposed to have a dollar sign if we're not using INDIRECT. so it doesn't have an impact. you cannot use a single column for range & multiple columns for the average_range. so i guess K m needs this in D4:
    =IFERROR(AVERAGEIF(INDIRECT("'"&D$3&"'!E2:E150"),$B4,INDIRECT("'"&D$3&"'!J2:J150")),"")

    this will give the same result as putting in up till column N, which is unnecessary because it's not calculating it.

+ 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