+ Reply to Thread
Results 1 to 5 of 5

Combining vlookup with offset?

  1. #1
    Registered User
    Join Date
    11-08-2007
    Posts
    7

    Combining vlookup with offset?

    I've been trying to automate a process whereby I transfer data from one worksheet to another in the same workbook.

    The original sheet has the data in the form of matrices, where, on the first row, there is a unique code specific to each matrix. Here's an example, with the unique code coloured red:

    Please Login or Register  to view this content.
    On the second worksheet, the data has to be transformed to look like this:

    Please Login or Register  to view this content.
    Where the data from the matrices are converted into columns.

    I'd like to be able to place the codes for the matrices into the first row of the second sheet, then search for that code in the first sheet, then using that cell as a reference, automatically return the data in columnar format.

    Does that make sense?

    I know how to use VLOOKUP to search for a unique code in a column, and I know how to use OFFSET to transform the data, by referring to a single cell. But I can't for the life of me figure out how to combine the two.

    Please help me avoid a meltdown!

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606
    Undoubtedly you can do this with formulae but I find it easier using code. I post this in case it's of use, which assumes the blocks have five columns.
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    11-08-2007
    Posts
    7
    I managed to work it out using a formula before I got back to read your response. I used INDEX and MATCH instead of VLOOKUP.

    Here's the formula:

    Please Login or Register  to view this content.
    ...and so on.

    It appears to work... Is there anything wrong with the formulae?
    Last edited by dlloyd; 11-08-2007 at 08:06 AM.

  4. #4
    Registered User
    Join Date
    11-08-2007
    Posts
    7
    (The unique code appears in Column B of Sheet 3, if that was not obvious)

  5. #5
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606
    Well if it works then I'd say there's nothing wrong with it. That's not to say that one of the formula experts wouldn't be able to shorten it considerably. Did you try the code?

+ 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