+ Reply to Thread
Results 1 to 9 of 9

Excel 2007 : Need Help with Indirect Hlookup.

  1. #1
    Registered User
    Join Date
    06-06-2012
    Location
    Artesia NM
    MS-Off Ver
    Excel 2007
    Posts
    5

    Need Help with Indirect Hlookup.

    This works but i need the sheet name to be variable. Thanx for any Help
    Would also like to be able to get sheet names from drop down list if possible
    without creating a list of sheets.

    =HLOOKUP(E9,'Day1'!$C$12:$AC$38,27,FALSE)
    Last edited by lmuncy; 06-06-2012 at 05:41 PM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Need Help with Indirect Hlookup.

    You will need to create a list of sheet names (on a hidden sheet perhaps) then you will need to NAME that range of cells holding the list. Once you have your named range, you can now use it as a Data Validation drop down List source.


    Assuming the drop down is in A9, the formula would become:

    =HLOOKUP(E9, INDIRECT("'" & A9 & "'!$C$12:$AC$38"),27,FALSE)
    _________________
    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-06-2012
    Location
    Artesia NM
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Need Help with Indirect Hlookup.

    Thanx for the quick response and help.

    It works but not quite the way i was hoping. E9 Thru ac9 are drop down list of Headers and b10 Thru B60 is a list of dates (sheet Name).
    But unfortunately Row 9 is not variable to the sheet names in Column B.
    What i want to happen is the columns of info to be client locateable so he can put the data for summary in order of his preference.
    Column B is sheet names and Row 9 is data columns. So when column b (sheet) is selected and row 9 data is selected be it c9 d9 e9
    the drop downs allow it to be d9 c9 f9 z9 l9 or whatever order my client prefers to see. Preferably whithout #ref! when nothing is selected
    in the the column or row.
    Last edited by lmuncy; 06-06-2012 at 06:38 PM.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Need Help with Indirect Hlookup.

    Guess it's time to post a workbook showing all this. Click GO ADVANCED and use the paperclip icon to post up a copy of your workbook. Make sure the workbook demonstrates your desired results if possible, or just highlight the cells you're trying to fix. Use BEFORE/AFTER sheets if that helps make it clearer.

  5. #5
    Registered User
    Join Date
    06-06-2012
    Location
    Artesia NM
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Need Help with Indirect Hlookup.

    Thanks for the help again
    Attached Files Attached Files

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Need Help with Indirect Hlookup.

    In D10, put this formula, then copy down and across the table, no editing needed:

    =IFERROR(HLOOKUP(D$9, INDIRECT("'" & $B10 & "'!$C$12:$AC$38"),27,FALSE), "")

  7. #7
    Registered User
    Join Date
    06-06-2012
    Location
    Artesia NM
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Need Help with Indirect Hlookup.

    Sorry to be your worst night mare Jerry. But its getting better. Now the problem is since row 9 (Drop Downs) refers to sheet (day1) for Headers. It still wont calculate the other sheet. It returns blanks. The worksheet automaticaly name themselves when a date is entered in A32. Then when you put coresponding date in the lookup i need it to get data from corresponding sheet. I tried using indirect in the source on the drop down tabs with no luck. I dont know if its the syntax or just not possible. Thanx again

  8. #8
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Need Help with Indirect Hlookup.

    No, it appears the problem is inconsistent sheet design.

    Day1, the headers are in row12, so your HLOOKUP works fine on that sheet.

    The sheet new has headers in row11, so HLOOKUP cannot see the headers. If you add the same empty row 11 into the sheet new as you have in sheet Day1 the formula works on that sheet, too. Hmm, it appears the new sheet has the totals on a different row, too, because your time ranges are different. Consistency in sheet design would eliminate all these issues.

  9. #9
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Need Help with Indirect Hlookup.

    Put the empty row11 into sheet new so the top row is the same on all sheets, then use this formula instead, it will INDEX the data table no matter how far down it goes (up to 100 rows), then it will find the Totals row on that sheet and bring back the answers from the row in the correct columns:

    =IFERROR(INDEX(INDIRECT("'" & $B10 & "'!$A$12:$AC$100"), MATCH("Daily Totals:", INDIRECT("'" & $B10 & "'!$A$12:$A$100"), 0), MATCH(D$9, INDIRECT("'" & $B10 & "'!$A$12:$AC$12"), 0)), "")

+ 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