+ Reply to Thread
Results 1 to 1 of 1

VBA code to compare multiple columns on two tabs and return matching values - Lookup

  1. #1
    Registered User
    Join Date
    10-28-2009
    Location
    Wilmington,DE
    MS-Off Ver
    Excel 2007
    Posts
    39

    VBA code to compare multiple columns on two tabs and return matching values - Lookup

    Dear All,

    Before turning to this forum and the helpful members, I have tried unsuccessfully to use excel's Look-up function in VBA to return a single value when several columns in one sheet are compared with columns on a different tab (sheet) with matching headers. I have attached a spreadsheet that has actual data and is basically set up the way I hope to use it.

    Essentially, I have a look-up table ("Portfolio Input") that has 6 columns: Position; Allocation; Day; HE; SoName; and SiName. I need to lookup the values in the Position and Allocation columns based upon the values in the other 4 columns. For example, if Day, HE, SoName and SiName all match the values on a different tab, "Results," then I would like to return the Position and Allocation values to the "results" tab to do calculations. If there is no match, then the returned result would be 0.

    The Row dimensions of the "Portfolio Input" lookup table are based upon 7 days, 24 hours and the total number of pairs which could be as large as 200; the table should have 6 columns.

    The data in the "Results" sheet grows every day by one day but will be restricted to one month of data. Columns A-L are fixed and are retrieved using an XML program written by an outside vendor. The Bid Column calculation, described on the "Results" sheet, needs to lookup the "Allocation" Value. The P/L Calculation needs the "Position" value from the ("Portfolio Input") sheet. Columns S and T are not necessary relevant when using VBA - I use them now because I populated these columns with excel look-up formulas.

    Why do this: I have made a lot of errors by manually dragging down the lookup formulas; by forgetting to drag the formulas when using a pivot table to view the data. So I would prefer to have this lookup done in VBA.

    If I can help in any way, I will do whatever is needed.

    With warm regards,

    Chris
    Attached Files Attached Files

+ 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. lookup multiple values in multiple columns to return a result
    By AYAHOO123 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-11-2013, 07:53 PM
  2. Return Y/N after matching from multiple lookup values separated by comma
    By indoglans in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-16-2011, 03:13 PM
  3. Lookup multiple values in multiple columns and return value
    By Mads2600 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-20-2010, 09:57 AM
  4. Compare Values in Multiple Columns and return a result
    By edbhome in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-18-2009, 09:37 AM
  5. Lookup in Multiple Columns, Return Multiple Values
    By andy62 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-05-2006, 09:40 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