+ Reply to Thread
Results 1 to 3 of 3

Help Excel Macro?: Assign values depending on list - Sizes and prices

  1. #1
    Registered User
    Join Date
    09-18-2012
    Location
    Hollywood, Florida
    MS-Off Ver
    Excel 2010
    Posts
    10

    Question Help Excel Macro?: Assign values depending on list - Sizes and prices

    Hi Excelforum members!

    I have a question... the answer might be a macro or maybe there is an easier solution...

    I have a table with a lot of columns, among those are two columns that are related...prices and sizes: depending on the size of the artwork (e.g-. 24x36) price will be something.

    These prices, are kept on another list, and they go by proportions...

    To summarize:

    I have two tables:

    A. The one with names, and sizes filled out, and an empty prices column
    B. One table with different proportions and their prices (see attached) Table example.xlsx

    How could I make excel fill out my prices column correctly, taking the prices from my table b? (if easier, I could copy this content into sheet2 of table A)


    Harder version:

    There's other data connected to those sizes that I would like to fill in too... like width and weight, but I feel like this will be way too complicated.

    Can anybody help me with this? or show me how to do it?

    Thanks, I really appreciate it!!

    Lola

    Table example.xlsx

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,422

    Re: Help Excel Macro?: Assign values depending on list - Sizes and prices

    Maybe:

    =VLOOKUP(Table1[[#This Row],[Size]],'Table B'!B:C,2,FALSE)


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Help Excel Macro?: Assign values depending on list - Sizes and prices

    Since ALL your sizes in Table B are unique, there are no duplicates, a simple VLOOKUP will do the work. Put this formula in C2:

    =VLOOKUP([@Size], 'Table B'!B:C, 2, 0)


    If you expand your table B to include the width and weight information, too, another VLOOKUP can be used to bring that data over, too.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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