Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Feb 2008
    Posts
    1,023
    Thanks
    63
    Thanked 2 Times in 2 Posts

    Vlookup with Offset

    I have the same text in Col B after 'TOTAL ADJUSTED GROSS PROFIT" and after "TOTAL NET (PROFIT)/LOSS"

    The values are in Col F

    I would like to look up the values for Dept1 , Dept2 etc but these departments appear twice

    The only way that I can see that this can be done is to use a a Vlookup together with an Offset function, but not sure how to do this

    It would be appreciated if someone can assist with a formula to do this
    Attached Files Attached Files

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 341 Times in 334 Posts
    In your specific example you could uses something like
    =VLOOKUP("Dept1",OFFSET(B1,0,0,5,5),5,0)

    =VLOOKUP("Dept1",OFFSET(B10,0,0,5,5),5,0)

    To be more general, you would need a way for the code to determine the starting cell (eg B1, B10) and the number of rows in the range (in these examples the first 5. The second 5 is the number of columns. The 3rd 5 is the column to do the lookup on.

    In your real dataset do you have something in Col A of B (or some other column) that can be matched to indicate the "section"?

    If you don't mind a UDF, you could use a VLIndex (http://windowssecrets.com/forums/sho...l=1#post346803 ) to get the 1st, second entry of the match:

    =vlindex("DEPT1",B1:B15,4,1)
    =vlindex("DEPT1",B1:B15,4,2)

    Steve

  3. #3
    5 Star Lounger
    Join Date
    Feb 2008
    Posts
    1,023
    Thanks
    63
    Thanked 2 Times in 2 Posts
    Thanks for the help, Steve. Will test & let you know

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •