Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Feb 2008
    Posts
    1,005
    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. Subscribe to our Windows Secrets Newsletter - It's Free!

    Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,212
    Thanks
    14
    Thanked 338 Times in 331 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

  4. #3
    5 Star Lounger
    Join Date
    Feb 2008
    Posts
    1,005
    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
  •