+ Reply to Thread
Results 1 to 8 of 8

Moving on a Hlookup by a number of cells each time??

  1. #1
    Registered User
    Join Date
    10-28-2009
    Location
    Birmingham, England
    MS-Off Ver
    Excel 2003
    Posts
    21

    Question Moving on a Hlookup by a number of cells each time??

    Hi Guys,

    I have been given a spreadsheet to fix as the user says the charts/graphs aren't adding the new data.

    But when I looked closer at the workbook the whole thing just seemed a little wrong to me

    Please see the workbook attached.

    All the data is entered into the sheet 'Data Entry'.

    Then on the 'Data' sheet it should pull thru some key values but half of it isn't done and it isn't very smart.

    I have created a 'TEST Data' sheet so I could start messing with it.

    I was going to pull the data thru from 'Data Entry' into the 'TEST Data' sheet using a Hlookup to make sure it worked before i messd with the actual 'Data' sheet.

    The problem I am having is moving/copying the Hlookup across.

    On the 'TEST data' sheet the Hlookup is as follows and is correct:

    =HLOOKUP($A$5,'Data Entry'!$C$4:$M$472,2,FALSE)

    But the next set of (Week 2) is not in the 2nd or even 3rd row of the array, its in row 11......... thats 9 rows down from the original.

    Moving on the data i want to bring back is always 9 more than the last so the Hlookups should look like:

    =HLOOKUP($A$5,'Data Entry'!$C$4:$M$472,11,FALSE)
    =HLOOKUP($A$5,'Data Entry'!$C$4:$M$472,20,FALSE)
    =HLOOKUP($A$5,'Data Entry'!$C$4:$M$472,29,FALSE)

    etc etc

    Can any of you guys out there help on how I can do this or it may not even be a Hlookup but something even smarter!!

    Thanks in advance
    Attached Files Attached Files
    Last edited by turbofatty; 11-02-2009 at 11:59 AM. Reason: SOLVED

  2. #2
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Houston, TX
    MS-Off Ver
    2013
    Posts
    2,191

    Re: Moving on a Hlookup by a number of cells each time??

    Try =HLOOKUP($A$5,'Data Entry'!$C$4:$M$472,(ROW()-5)*9+2,FALSE)

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Moving on a Hlookup by a number of cells each time??

    In C5 try:

    =HLOOKUP($A$5,'Data Entry'!$C$4:$M$472,9*(COLUMNS($A$1:A1)-1)+2,FALSE)

    copied across.

    in C6:

    =HLOOKUP($A$5,'Data Entry'!$C$4:$M$472,9*(COLUMNS($A$1:A1)-1)+9,FALSE)

    and so on...adjusting the red number to meet the first row that you need to get and copy across.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  4. #4
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Houston, TX
    MS-Off Ver
    2013
    Posts
    2,191

    Re: Moving on a Hlookup by a number of cells each time??

    Sorry, I went too fast on this one. I always assume people have sheets set up to drag formulas down. NBVC is, as usual, right.

  5. #5
    Registered User
    Join Date
    10-28-2009
    Location
    Birmingham, England
    MS-Off Ver
    Excel 2003
    Posts
    21

    Thumbs up Re: Moving on a Hlookup by a number of cells each time??

    NBVC and darkyam, you are a pair of genius'!!!

    I don't know how you do it but i'll bank this one and remember it!!

    It could come in quite handy in the future!!

    I'm not sure how this COLUMNS function works at the end of the hlookup, but it does!!

    I'll try and figure it out!!

    Cheers once more Guys!!!

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Moving on a Hlookup by a number of cells each time??

    Hint:

    Use the Formula Auditing|Evaluate tool found in Tools menu to step through the formula and see what is happening.

  7. #7
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Houston, TX
    MS-Off Ver
    2013
    Posts
    2,191

    Re: Moving on a Hlookup by a number of cells each time??

    Or you can highlight parts of the formula (making sure you get beginning and ending parentheses for a function) and hit F9.

  8. #8
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Moving on a Hlookup by a number of cells each time??

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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