+ Reply to Thread
Results 1 to 10 of 10

multi cell vlookup

  1. #1
    Registered User
    Join Date
    06-15-2010
    Location
    London
    MS-Off Ver
    Excel 2013
    Posts
    10

    multi cell vlookup

    I need to do a multi cell vlookup and I am not sure how to do it.


    My data is as follows:-


    Column J is a drop down (e.g. Tourist, Entry,….(up to 12 choices))

    Column K is a Vlookup to lookup a price associated with the value entered in column J (i.e. =VLOOKUP(J2,'Costs'!$A$2:$J$13,2,FALSE)

    Column L is a drop down (e.g. M, K, MT,…. (up to 8 choices))

    Column M should extrapolate a value that matches the value entered in column J and the price associated with the value entered in column L.

    What I am unsure about is how I would set up the vlookup for the second scenario.

    How can I concatenate vlookup to select col J and Column L?

    Would I need a new area that defines all permutations of column J and column L?

    I would appreciate any help (I am using office 2003)
    Last edited by NBVC; 03-28-2011 at 07:27 AM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    re: multi cell vlookup

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    re: multi cell vlookup

    I think you need to supply a sample file (without sensitive data) showing how your data is arranged.

    Include an explanation (with examples) of what results you want and the logic behind achieving those results.

  4. #4
    Valued Forum Contributor Sadath31's Avatar
    Join Date
    03-02-2011
    Location
    Dammam, Saudi Arabia
    MS-Off Ver
    Office 365
    Posts
    452

    re: multi cell vlookup

    you are not mentioned here the result range,
    Try this formula
    =Match(LookupValue1&LookupValue2,LookupRange1&LookupRange2,0)
    this will return row number which matches the criteria.
    Hope this will do.

  5. #5
    Registered User
    Join Date
    02-10-2011
    Location
    Manchester, England
    MS-Off Ver
    Excel 2007
    Posts
    5

    re: multi cell vlookup

    I would think it depends on how the relationships between column J and L work. However, taking a bit of a guess at how your sheet may be structured:

    Example 1: if there is 1 to 1 link between column J and column L

    If the value of L is driven directly by J (for example if J is 'tourist' L has to be a set amount which will be the same every time J is 'tourist') then you can drive the value of L from either IF statements, e.g. in L2:
    IF(J2="Tourist"),"Value for tourist",nestle further IF statements here)
    or you could do a small VLOOKUP to a table with the two columns for values of J and corresponding values for L
    Either of the above two could then be used to drive your formula

    If there is not a 1 to 1 relationship between J and L
    There are a number of questions that would need to be answered to decide the best route. 2 options would be. As I don't know what each column is for I will use if J was a column for 'type of resident', e.g. tourist and L was a column for 'type of room' and M was a column for 'price to charge'

    Example 2: There is a fixed relationship between J and L that calculates M

    I guess that it is not this as it is quite simple, a simple formula such as
    IF(J2="Tourist"),50,if(J2="Resident",40,100)) + If(L2="luxury",25,10)
    would charge a total rate dependent on the type of resident (£50 for a tourist, £40 for a resident, £100 if anything else) plus the room type (a further £25 for a luxury room and £10 for non luxury)

    Example 3: If there is more of an arbitrary decision that determines the value of M (or it cannot be calculated)

    Lets say it is the same example as above but an arbitrary decision has been made on the total cost for each situation then you could put these figures into a table (say with the x axis being type of resident and y axis being type of room.

    You can nestle a MATCH formula in your VLOOKUP, so you run a VLOOKUP as normal to find the correct row for the type of resident. The column_index_num section of the VLOOKUP is then a MATCH formula:
    MATCH(lookup_value,lookup_array,match_type)
    The full formula being:
    VLOOKUP(J2,table_array,MATCH(L2,lookup_array,0),FALSE)
    where table_array is the entire table you created for the values of M and lookup_array in the header row of that table.

  6. #6
    Registered User
    Join Date
    06-15-2010
    Location
    London
    MS-Off Ver
    Excel 2013
    Posts
    10

    Re: multi cell vlookup

    Thanks for your help so far.

    I attach a sample workbook.

    The after sheet has been filled in with examples of cost for column headed Agent Fee.
    Attached Files Attached Files

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: multi cell vlookup

    Try:

    =INDEX(Cost!$B$2:$J$21,MATCH(J2,Cost!$A$2:$A$21,0),--MATCH("*"&L2&" *Fees",Cost!$B$1:$J$1,0))

    copied down

  8. #8
    Registered User
    Join Date
    06-15-2010
    Location
    London
    MS-Off Ver
    Excel 2013
    Posts
    10

    Re: multi cell vlookup

    This works a treat.

    Can you please tell me what the particular functions do (only way I will understand and learn).

    Also if I enter more columns in the future for additional agents on sheet COST will your solution still work?

    Thank you for your help so far.

  9. #9
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: multi cell vlookup

    Here is a good lesson to start with Index/Match

    the * in the MATCH function are wildcards.

  10. #10
    Registered User
    Join Date
    06-15-2010
    Location
    London
    MS-Off Ver
    Excel 2013
    Posts
    10

    Re: multi cell vlookup

    Thank you for your invaluable help.

+ 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