+ Reply to Thread
Results 1 to 7 of 7

Codes for Matching HSCodes

  1. #1
    Registered User
    Join Date
    11-27-2008
    Location
    Manila, Philippines
    Posts
    20

    Exclamation Codes for Matching HSCodes

    Good day!

    i have raw data which has fieldname 'hscodes' in worksht_1. in worksht_2 i have list of codes (hscodes, 10digit codes) indicating its respective pvoc (X for exempted, Y for subjected). I wanted to match the hscodes in worksht_1 and create a new fieldname = 'PVOC' and put X or Y depending on its HScode with reference to hscodes in worksht_2.

    thanks and have a great day!

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492
    This will go fast if you post a sample, less "guesswork".
    _________________
    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!)

  3. #3
    Registered User
    Join Date
    11-27-2008
    Location
    Manila, Philippines
    Posts
    20
    Quote Originally Posted by JBeaucaire View Post
    This will go fast if you post a sample, less "guesswork".
    In worksheet_2-List of Codes
    "PVOC" "HSCodes"
    X 2106100000
    X 2710115000
    X 2710119000
    X 2710194100
    X 2710194900
    X 3926400000
    X 4012901000
    X 5212110000
    X 5212210000
    X 7804200000
    X 8005000000
    X 8207200000
    Y 2712000000
    Y 2712000000
    Y 2833300000
    Y 2835390000
    Y 3006100000
    Y 3006200000
    Y 3505200000
    Y 3505100000
    Y 3506100000
    Y 3808400000
    Y 4010310000
    Y 4010390000
    Y 4820200000
    Y 4820300000
    Y 4820900000
    Y 4821109000
    Y 4822900000


    In Worksheet_1 Raw data

    HS CODE "PVOC
    (X = Exempted Y = subject)"
    7020009000 ?
    6913900000 ?
    4804110000 ?
    8701209000 ?
    8703239000 ?
    8523211000 ?
    6506100000 ?
    6307200000 ?
    8515900000 ?
    8515390000 ?

    Do a macro that would determine if PVOC is X or Y or None given the codes in Worksheet_2.

    thanks.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    We'd be more grateful if you'd post a workbook.
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Registered User
    Join Date
    11-27-2008
    Location
    Manila, Philippines
    Posts
    20
    Quote Originally Posted by shg View Post
    We'd be more grateful if you'd post a workbook.
    Please see attached file containing sample data. Thanks.
    Attached Files Attached Files

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    First, you need to copy down the X's and Y's into the blank cells adjacent to the codes on the first sheet. Then on sheet Raw in B5 and copy down,

    =INDEX('List of Codes'!A:A, MATCH(Raw!A5, 'List of Codes'!B:B, 0), FALSE)

  7. #7
    Registered User
    Join Date
    11-27-2008
    Location
    Manila, Philippines
    Posts
    20

    Thumbs up solved

    Quote Originally Posted by shg View Post
    First, you need to copy down the X's and Y's into the blank cells adjacent to the codes on the first sheet. Then on sheet Raw in B5 and copy down,

    =INDEX('List of Codes'!A:A, MATCH(Raw!A5, 'List of Codes'!B:B, 0), FALSE)
    You're an angel!

    Im learning a lot in this forum. Im enjoying my journey in learning Advanced Excel.. Thanks to all of you!

+ 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