+ Reply to Thread
Results 1 to 5 of 5

vlookup with variables

  1. #1
    Forum Contributor
    Join Date
    04-03-2014
    Location
    Berlin
    MS-Off Ver
    Excel 2010
    Posts
    160

    vlookup with variables

    Hey everyone,

    I've got two worksheets A & B with:
    A - the source of data
    B - the destination sheet

    I'm trying to put together a code with a vlookup at it's core that should:
    1. compare column "F" from worksheet "B" with column "G" from worksheet "A"
    2. assign the correspondént values in column "P" in worksheet "B" as they appear in the correspondent reporting month from worksheet "A".

    In this case the month is October.
    However it would be great if the code would be able to determine which monthly values need to be assigned in worksheet "B" by comparing the monthly headlines from worksheet "A" with the month selection in worksheet "list".
    Where the corespondent month has been found in worksheet "A", the code should pick the column index from the cell above.

    Please see attachment and many thanks for your support!

    regards,
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor nigelbloomy's Avatar
    Join Date
    11-06-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    1,011

    Re: vlookup with variables

    This in P2 should work:

    Please Login or Register  to view this content.
    Some people volunteer in soup kitchens or hospitals. I choose to make the world better by trying to help you with Excel. We're all learning.

    <---Click * Add Reputation for all helpful comments. It's like giving a smile.
    Forum Rules: How to mark your post [Solved] and have a happier, Excel enriched life.

  3. #3
    Forum Contributor
    Join Date
    04-03-2014
    Location
    Berlin
    MS-Off Ver
    Excel 2010
    Posts
    160

    Re: vlookup with variables

    thanks for your reply nigelbloomy,

    yes the formula makes sense - however for some reason it does not work. I'm getting a #NV in P2.
    Could you please have a look? thanks!

    regards

  4. #4
    Forum Contributor
    Join Date
    04-03-2014
    Location
    Berlin
    MS-Off Ver
    Excel 2010
    Posts
    160

    Re: vlookup with variables

    sorry - I had a typo in my formula

    It works perfectly after correction!!!

  5. #5
    Valued Forum Contributor nigelbloomy's Avatar
    Join Date
    11-06-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    1,011

    Re: vlookup with variables

    Oh good. I am glad it works. Thanks for the rep too.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. VLookup two Variables
    By domnicmifsud in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-15-2016, 09:37 AM
  2. Vlookup with 2 variables
    By Armitage2k in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-21-2014, 03:13 AM
  3. vlookup against various variables
    By papah73 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-25-2014, 06:36 AM
  4. [SOLVED] Vlookup two variables
    By PERE in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-28-2013, 06:36 AM
  5. [SOLVED] Can I identify variables using VLOOKUP, and then pass variable to another VLOOKUP?
    By Jeff C in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-05-2012, 05:54 PM

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