+ Reply to Thread
Results 1 to 13 of 13

Problems with creating a formula for a lookup

  1. #1
    Registered User
    Join Date
    09-30-2014
    Location
    Johns Island, South Carolina
    MS-Off Ver
    Office for Mac 2011
    Posts
    25

    Problems with creating a formula for a lookup

    I'm working on a huge list (over 150,000 rows) where I need a formula to find out the weight of each item. I have tried the "IF" function but I'm very limited in what I know about it so I got stuck in creating the formula and what I came up with I needed to manually change every time the SKU change. Here is what I would need help with:

    Column A is the External SKU, Column B is the internal SKU, Column C is the Weight and Column D should be the result. We have a bunch of Item SKU's which are inconsistent in the amount of numbers, letters and special characters. The external SKU needs to be broken down into the internal SKU which then defines the weight of the item. So I would need is some type of formula which would solve the following: If parts of entry in Column A equal one of the entries in B & C then show the exact weight in Column D (See my attached sample). I hope my description is somewhat understandable. I would appreciate any kind of input/help.

    Thanks in advance for your help.
    Attached Files Attached Files

  2. #2
    Forum Expert dosydos's Avatar
    Join Date
    12-09-2015
    Location
    Massachusetts
    MS-Off Ver
    365(PC) V:2308
    Posts
    1,472

    Re: Problems with creating a formula for a lookup

    I think this is what you are looking for. Try this formula in D2

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    09-30-2014
    Location
    Johns Island, South Carolina
    MS-Off Ver
    Office for Mac 2011
    Posts
    25

    Re: Problems with creating a formula for a lookup

    Thank you for your answer dosydos. Your suggestion works, but I forgot to mention an important point. The entries in Column A and Column B do not always match (see new attachment). Column B & C is there to list the different Internal SKU's with their weight, so that I have some sort of pointers for Column A. With your formula, as soon as Column B doesn't match with Column A, I don't get a result. Do you have any idea on how I can enhance your suggestion so that it would work for all the entries in Column A?Anoter SKU Weight.xlsx

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Problems with creating a formula for a lookup

    So what would you expect to be the result in row 123 and why?

    Better yet, row 137
    Last edited by ChemistB; 02-05-2016 at 12:42 PM.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  5. #5
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Problems with creating a formula for a lookup

    I still get some errors but that might be because the example isn't a complete list ???

    In D2 copied down

    =IF(ISNUMBER(FIND("-",A2)),INDEX($C$2:$C$416, MATCH(MID(A2, FIND("-", A2)+1,50), $B$2:$B$416,0)), INDEX($C$2:$C$416, MATCH(A2, $B$2:$B$416,0)))

  6. #6
    Registered User
    Join Date
    09-30-2014
    Location
    Johns Island, South Carolina
    MS-Off Ver
    Office for Mac 2011
    Posts
    25

    Re: Problems with creating a formula for a lookup

    The result in row 123 would be 5.4 as the part from the external SKU (M100AG1) which is what I'm looking for is in Row 154 (Column B) and that equals 5.4 (Column C). So basically what I'm looking for is "If part of External SKU (Column A) can be found somewhere in Internal SKU (Column B) than show the weight of it (Column C) in Result (Column D). Hope this makes sense.

  7. #7
    Registered User
    Join Date
    09-30-2014
    Location
    Johns Island, South Carolina
    MS-Off Ver
    Office for Mac 2011
    Posts
    25

    Re: Problems with creating a formula for a lookup

    yet that's it. It works. The errors are because I haven't added all options to Column B yet. But this is the solution I was looking for. Thank you so much for your help.

  8. #8
    Registered User
    Join Date
    09-30-2014
    Location
    Johns Island, South Carolina
    MS-Off Ver
    Office for Mac 2011
    Posts
    25

    Re: Problems with creating a formula for a lookup

    Ok, I hope I have to ask for the last time. The given solution =IF(ISNUMBER(FIND("-",A2)),INDEX($C$2:$C$423, MATCH(MID(A2, FIND("-", A2)+1,50), $B$2:$B$423,0)), INDEX($C$2:$C$423, MATCH(A2, $B$2:$B$423,0))) works great, but now I came across another issue. Some of the external SKU's have two dashes (BOC-001BOS-M100AG7) and some have 3 dashes (EURO-002-IRE-M700WH4). The solution works only for SKU's with one dash (ABC001-M100AG1).
    I have tried changing the formula but did not have success yet. Does someone have an idea on how I can change the formula to search data with one, two and three dashes?

  9. #9
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Problems with creating a formula for a lookup

    Is the sku from Col B always at the end?

  10. #10
    Registered User
    Join Date
    09-30-2014
    Location
    Johns Island, South Carolina
    MS-Off Ver
    Office for Mac 2011
    Posts
    25

    Re: Problems with creating a formula for a lookup

    yes, it's always at the end.

  11. #11
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Problems with creating a formula for a lookup

    Try this formula

    =INDEX($C$2:$C$416, MATCH(MID("-"&A2, FIND("^", SUBSTITUTE("-"&A2,"-","^", LEN(A2)-LEN(SUBSTITUTE(A2,"-",""))+1))+1,50),$B$2:$B$416,0))

  12. #12
    Registered User
    Join Date
    09-30-2014
    Location
    Johns Island, South Carolina
    MS-Off Ver
    Office for Mac 2011
    Posts
    25

    Re: Problems with creating a formula for a lookup

    Thanks again. It works and I have not found any issues this time. Seems I have finally what I need. You saved my weekend.

  13. #13
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Problems with creating a formula for a lookup

    Glad to help.

+ 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. Problems with creating formula's
    By StephenVerheul in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-28-2015, 06:15 AM
  2. Replies: 3
    Last Post: 06-21-2014, 11:44 AM
  3. [SOLVED] lookup formula problems
    By amartino44 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 06-11-2013, 06:23 PM
  4. [SOLVED] Lookup Formula/array problems, need help!
    By Speshul in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-28-2012, 05:02 PM
  5. Replies: 2
    Last Post: 10-03-2011, 01:29 PM
  6. problems with IF formula to lookup a table
    By sav1979 in forum Excel General
    Replies: 4
    Last Post: 04-19-2011, 04:25 PM
  7. [SOLVED] Problems with a Lookup formula
    By Vix in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-02-2006, 12:25 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