Find size data from Item Title column to create a Size column

frewert

Board Regular
Joined
Apr 4, 2014
Messages
188
Office Version
  1. 365
Platform
  1. Windows
Originally the workbook only contained Column A and the intention is to create Column C (Size Column).

Here is my workbook so far.
Here is an image preview.

I have highlighted the ones that aren't working as intended and put a column of what the desired result should be.

You will notice I have columns F and G that are valid sizes and conversions.

My goals now:
  • Item Titles with (Number)X(Number) should return the first number. E.g., 32X30 should return 32.
  • Item Titles with M/L are returning nothing. It should return L (the largest size)
  • Item Titles ending in 0,2,4,6,8,S,M,L are not returning a result. Something to do with not being surrounding by the space character.
  • Item Titles with 6S, 6R, 6M, 6L, 6T should return 6. (Should work with all numbers, not just 6 in example)

Here is the vba code used. (credit: reddit.com/user/arkangelshadow007)
VBA Code:
Sub shoe_sizes()

Dim items As Range, validSizes As Range, conversion As Range

Set validSizes = Range("f2:f200") 'adjust ranges
Set conversion = Range("g2:g200")
Set items = Range("a2:a4200")

For Each Item In items.Cells

    For Each validSize In validSizes.Cells

        x = InStr(Item.Value, validSize.Value)

        If x > 0 Then

            Cells(Item.Row, 3) = Cells(validSize.Row, 7)

            GoTo next_item

        End If

    Next validSize

next_item:

Next Item

End Sub

Thank you!
 
You should check records that returns empty result, there are many, see if they are actually should give some result. If so, we need to revise the code.
 
Upvote 0

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
You should check records that returns empty result, there are many, see if they are actually should give some result. If so, we need to revise the code.
This is true. I have attached an image that addresses all the blanks.
 

Attachments

  • j3 1.JPG
    j3 1.JPG
    156.5 KB · Views: 9
Upvote 0
I will return sometime tomorrow. If you are up for it, I have a few other columns I'd like to make.

Your skills are the best! Thanks a lot.
 
Upvote 0
Ok, I'll try to revise the code when I have time in a few hours.
 
Upvote 0
Can you update the list in col F:G first to include the rest of the criteria? Just exclude the part with "ties. scarves. wallets. hats. bags" because I will put these words in the code.
And it would be best if you can post your data using XL2BB TOOLS.
 
Upvote 0
Can you update the list in col F:G first to include the rest of the criteria? Just exclude the part with "ties. scarves. wallets. hats. bags" because I will put these words in the code.
And it would be best if you can post your data using XL2BB TOOLS.
Ok I have updated F:G with XXS, 0XWP..3XWP, 1XL.
I'm not sure what you need me to do about Torrid. The brand has sizes:
Book1
AB
1TORRID SIZESEQUIVALENT SIZES
200X
311X
422X
533X
644X
755X
866X
Sheet1

Typically I always create the titles with both 2 and 2X for example, but you can see a few I did not do that.

Here is the updated sheet.
Size project method C.xlsm
ABCDEFG
1Item TitleSizeList of valid size entriesreplace entries
2Lands End Denim Shirt Womens M 10/12 Cotton Vintage Long Sleeve Button UpM7XP7XP
3Lululemon 11" Shorts Mens XL Black Zip Pockets Elastic Waist Drawstring VintageXL6XP6XP
4LC Lauren Conrad T-Shirt Womens 2XL XXL Plus Crew Short Sleeve Cotton Floral2XL5XP5XP
5Dickies Long Sleeve Pocket Tee Mens 3XL XXXL Orange Relaxed Performance Wicking3XL4XP4XP
6Croft & Barrow Blouse Womens 2X Blue 3/4 Sleeve Knit Spandex2X3XP3XP
7Chicos Travelers Dress Womens 3 (US: XL) Black Acetate Spandex Sheath SleevelessXL2XP2XP
8Old Navy Active 5.5" Shorts Womens 3X Plus Olive Camo Stretch Tech Zip Pocket3X1XP1XP
9Allison Daley T-Shirt Blouse Womens 1X Polyester Spandex Short Sleeve Colorful1X0XP0XP
10Old Navy NWT Wide Linen Blend Pants Womens Large Flax Beige Pockets High RiseL3XWP3XP
11Apt 9 Kohls Snake Print Top Shirt Blouse Cotton Stretch Womens Plus 1X1X2XWP2XP
12American Eagle Mom Short Womens 6 High Rise Zip Distressed Denim 2.5" Inseam61XWP1XP
13D&Co Active Sleeveless 1/4 Zip Shirt Womens 1X Blue Cotton Spandex Tank Golf1X0XWP0XP
14Croft & Barrow The Classic Tee Womens 1X Cotton Black Polka Dot T-Shirt Crew SS1X26P26P
15Old Navy 100% Cashmere Sweater Full Zip Hoodie Womens XL (S, M) Long SleeveXL24P24P
16We The Free People Denim Cut-off Shorts Womens 26 2" Blue Cotton Fringe2622P22P
17Melissa Paige NWT Petite Elastic Waist Skirt Blue Polyester Lined Womens PXLPXL20P20P
18Nike Dri Fit Shirt Womens Large Relaxed Long Sleeve Teal Heather Crew RaglanL18P18P
19Nike Performance Polo Shirt Mens 2XL XXL Red Striped Short Sleeve Polyester2XL16P16P
20JMS Just My Size NWT Blouse Polo Womens 2X 18W 20W Yellow 3/4 Sleeve Cotton2X14P14P
21Old Navy Boyfriend Mid Rise Blue Denim Shorts Womens 22 Cotton Stretch 2.5" Inse2212P12P
22Nike Golf Shorts Pleated Beige Polyester 10" Mens 333310P10P
23Croft & Barrow Blouse Womens 2X Rayon Spandex Black Ruched Cuffs Pleated2X8P8P
24Woman Within Dress Womens 3X 30/32 Rayon Black Short Sleeve Floral3X6P6P
25Sonoma T-Shirt Womens 2XL XXL Yellow Paisley Print Cotton Polyester Short Sleeve2XL4P4P
26Athleta Salutation Stash Pocket II 7" Short Womens 2X Blue Nylon Lycra Spandex2X2P2P
27NYDJ NWT Capri Jeans Original Slimming Fit Womens 24W Denim Stretch24W0P0P
28Swannies Polo Shirt Mens Medium Blue Polyester Spandex Short Sleeve StripedM00P00P
29Levis 511 Denim Shorts Mens 30 Cotton Blue 11" Inseam Slim30P7XLP7XL
30Fila Sport NWT Golf Polo Shirt Mens 4XB 4X Big Gray Athletic Fit Polyester Wick4XBP6XLP6XL
31Under Armour T-Shirt Womens 2XL XXL Pink Threadborne Loose Fit HeatGear V-Neck2XLP5XLP5XL
32Lucky Brand Blouse Womens Medium Blue V-Neck Short Sleeve Elastic WaistMP4XLP4XL
33Perceptions Dress Womens 1X Floral Black Yellow Sleeveless A-Line Swing Stretch1XP3XLP3XL
34Red Hot By Spanx Full Slip Womens Large Spandex Nylon Soft Nude Lace SlimmingLP2XLP2XL
35Knox Rose Kimono Blouse Womens M/L Rayon Open Front Floral Red StainLPXLPXL
36Susan Graver Ultra Stretch Pull On Pedal Pushers With Pockets Womens XLXLXLPPXL
37Suzanne Betro NWT Shirred Fit & Flare Dress Black/White Crew Stretch Womens MMPLPL
38Tommy Bahama Orange Striped Polo Shirt Polyester Mens Medium MMLPPL
39Champion Tank Top Mens 5XLT Gray Spell out Cotton Blend T-Shirt5XLTPMPM
40Outdoor Research NWT T-Shirt Mens Large Echo Duo Tee Pewter Alloy Gray PolyesterLMPPM
41Chaps Blouse Womens 3X Cotton Blend Beach Palm Trees Short Sleeve Blue3XSPPS
42White Stag Sport Collection Blouse Womens 22W 2X Blue Polyester Cotton2XPSPS
43Love + Joy Blouse Womens 3X Yellow Floral V-Neck Short Sleeve Elastic Waist3XPXSPXS
44Quacker Factory Snap Front Cardigan Womens Medium Yellow Floral Long SleeveMP2XSP2XS
45Tahari 100% Cashmere Sweater Womens Small Beige Pockets Luxe Long SleeveS7XB7XB
46Style & Co Woman Embellished V-Neck Blue/Green Top Blouse Nylon Womens 2X2X6XB6XB
47Carhartt Polo Shirt Mens 2XLT Tall Green Pocket Short Sleeve Loose Fit2XLT5XB5XB
48Maurices Cardigan Sweater Womens 2X Open Front Ruffle Dolman Rayon Blend2X4XB4XB
49Wilfred Merino Wool Sweater Womens Medium Brown Mock Long SleeveM3XB3XB
50Duluth Trading Shirt Mens XL Trim Fit Multicolor Check Plaid Short Sleeve ButtonXL2XB2XB
51Old Navy Sweater Pullover Womens 2XL XXL Cotton Blend Classic Crew Gray2XL1XB1XB
52Croft & Barrow Button Front Shirt Womens 3X Cotton White Flamingo Pockets Stain3X6XLT6XLT
53Old Navy Mens XL Navy/Gray Gingham Plaid Shirt Long Sleeve Built In Flex ButtonXL5XLT5XLT
54Arcteryx T-Shirt Mens Medium M Gray Law Enforcement Armed Forces CrewM4XLT4XLT
55Falls Creek Dress Womens 2X Cotton Spandex Short Sleeve V-Neck Fit Flare Red2X3XLT3XLT
56Maurices Tank Top Blouse Womens 2X Rayon Ruffle Sleeveless Red2X2XLT2XLT
57Knox Rose Tank Top Blouse Womens Large Blue White Floral Sleeveless Rayon CamiLXLTXLT
58Torrid Button Front Shirt Womens 2 2X Blue Tencel Chambray Sleeveless Dolman2XLTLT
59Lands End No Iron Pinpoint Oxford Shirt Womens 14 Long Sleeve Cotton Floral14MTMT
60Ellen Tracy Linen Pants Womens XL Navy Blue Pull On Elastic Crop Capri PocketsXL7XL7XL
61Lands End Sport Tank Top Blouse Blue Stretch Womens 2X2X6XL6XL
62J Crew Pull On Pants Womens 10 Linen Cotton Striped Gray White Drawstring Pocket105XL5XL
63Torrid Cropped Cami Linen Blend Top Womens 1 1X Blue Stretch Smocked1X4XL4XL
647 For All Mankind Luxe Performance The Straight Mens Jeans 36X31 Stretch363XL3XL
65American Eagle Vintage 7" Shorts Womens 14 Cotton Denim Blue Cut Off142XL2XL
66Levis 525 Straight Perfect Waist Jeans Womens 6S Cotton Spandex Original6XLXL
67Shein T-Shirt White Tee Crew Short Sleeve Flag/Sunflower Stretch Womens XLXL1XLXL
68Eddie Bauer Adventurer 2.0 Skort Womens 8 Green Polyester Spandex Short Liner8LL
69J Crew Draped Pocket Tank Tunic Top Polyester Sleeveless Womens Size 44MM
70Levis Premium Big E Wedgie Jeans Womens 30 Cotton Stretch Distressed Blue30SS
71Old Navy Boyfriend Flannel Shirt Womens 2XL XXL Red Plaid Long Sleeve Cotton2XLXSXS
72JM Collection Round Neck Beaded Blouse Top Shirt Cotton Modal Womens 3X3X2XS2XS
73Karen Scott Pullover Sweater Womens 2X Red Cotton Raglan Crew Knit2XXXS2XS
74Catherines Dress Womens 4X Short Sleeve Red Tiered Shift Lined Polyester 32W 30W4X7X7X
75Lands End Polo Shirt Womens 2X 20W 22W Red Polka Dot Cotton Spandex Short Sleeve2X6X6X
76Terra & Sky 4" Shorts Womens 2X 20W 22W Tie Dye Drawstring Elastic Waist Soft2X5X5X
77I Love Jesus And Naps T-Shirt Womens 18 20 2X 2 Elly And Grace Live And Tell NWT2X4X4X
78Sara Michelle Blouse Womens 2X Polyester Green Tiered Lined Short Sleeve2X3X3X
79American Eagle Womens 6 Vintage Hi Rise Festival Distressed Gray Shorts Denim62X2X
80C Est 1946 Cato Blouse Womens 22/24W 3X Floral Polyester Spandex3X1X1X
81JM Collection Linen Shirt Womens 24W 3X Button Front Pocket Floral Tab Sleeve3X0X0X
82Maeve Womens Sz 4 Scallop Swiss Dot Blouse Top Blue Navy Rayon Crew Neck4XXXL3XL
83Terra & Sky Sheer Blouse Button Front Black Floral Long Sleeve Womens 3X 24W 26W3XXXL2XL
84Catherines Suprema Collection T-Shirt Womens 1X 18/20W Green Cotton Spandex V1XLargeL
85Uniqlo Button Front Shirt Womens 2XL XXL Poly/Rayon Long Sleeve Flaw2XLMediumM
86River Trader Button Front Shirt Mens 2XL XXL Seer****** Cotton Pocket SS Yellow2XLSmallS
87Chaps Blouse Womens 2X Polyester 3/4 Sleeve All Over Floral Print2X44W44W
88Cato Blouse Womens 18/20W 2X Brown V-Neck Short Sleeve Elastic Waist2X42W42W
89Eliane Rose Blouse Tank Womens 1X Plus White Teal Brown Viscose Spandex Tunic1X38W38W
90LL Bean Chamois Cloth Shirt Mens Large Regular Red Pockets Long Sleeve CottonL36W36W
91Croft & Barrow Light Jacket Womens 1X Green Paisley Full Zip Polyester1X34W34W
92Banana Republic Pants Mens 34X28 Linen Cotton Straight Fit Beige Plaid Pro Hem3432W32W
93Shein Curve Fit Flare Dress Womens 2XL Pink Hearts V Wrap A-Line Short Sleeve2XL30W30W
94American Eagle Hi Rise Festival Shorts Womens 4 Cotton Distressed Blue Denim Zip428W28W
95Protege Collection Cosby Sweater Mens XLT Made USA Black Crew PulloverXLT26W26W
96Belle Sky Blouse Womens 2X Blue Tie Neck Long Sleeve Polyester Ruffle2X24W24W
97White Stag NWT Draped Tankini Spandex Black Halter Womens 3X 22W 24W3X22W22W
98Boden Dress Womens 6P Cotton Spandex Short Sleeve Empire Tulip Jersey Gray6P20W20W
99Old Navy Active Powersoft Leggings Womens Large Go Dry High Rise Gray HeatherL18W18W
100Chicos Weekends Blouse Tunic Womens 1 (US Medium) 8 Green Floral 3/4 SleeveM16W16W
101Old Navy Button Front Shirt Mens 2XL XXL Blue Slim Built In Flex Pocket SS2XL14W14W
102The North Face Narrows Short Mens 34 Shorts Distressed Straight Twill 8" Inseam34One SizeOne Size
103Terra & Sky Blouse Womens 1X 16W 18W Cotton Short Sleeve Notch Neck Swing Orange1XAll SizesOne Size
104LL Bean Button Front Shirt Womens Medium Reg Pink Stripe Long Sleeve StainM6060
105Cato Blouse Womens 18W 20W Brown Paisley Split Round Hem 3/4 Sleeve V-Neck 2X2X5858
106Adidas Leggings Womens 2X Primegreen Aeroready Pink Abstract2X5656
107Sag Harbor Button Front Shirt Womens 1X Polyester Lined Short Sleeve Orange V1X5454
108Alice + Olivia Blouse Top Womens XS Stretchy Cropped Snake Print Long SleeveXS5252
109LOFT Ann Taylor Blouse Womens XL Yellow 3/4 Sleeve CottonXL5050
110Terra & Sky Button Front Shirt Womens 1X 16W 18W Blue Stripe Pockets SS1X4848
111Torrid Jogger Pants Womens 3 3X Green Cargo Rayon Stretch Pull On Elastic3X4646
112Guess Linen Pants Cropped Capri Black Drawstring Womens 32324444
113Eddie Bauer T-Shirt Mens 2XL XXL Cotton Black Long Sleeve Mock2XL4242
114Old Navy NWT Slim Jeans Mens 38X31 Black Wash Cotton 360 Stretch Zip Mid384040
115Muk Luks Womens Cabin Sock NWT Black L/XL 8-10 Slip Resistant Warm CozyXL3838
116George Long Sleeve Button Front Shirt Mens 2XL XXL Blue Pink Check Plaid Cotton2XL3636
117Lands End Tunic Blouse Womens XL 18 Gray Pockets Long Sleeve V-Neck Cotton BlendXL3535
118CJ Banks Button Front Blouse Womens 2X Linen Rayon Black Pockets Jacket2X3434
119Talbots Pants Womens XLP Petite Plaid Black Blue Spandex Leggings Pull OnPXL3333
120Blair Pull On Capri Pants 24W Teal Pockets Elastic Waist Cotton Polyester24W3232
121Eddie Bauer Parka Coat Womens 1X Orange Cotton Polyester Hooded1X3131
122Levis Denim Shirt Mens XL Cotton Long Sleeve Pockets Charcoal Wash Button UpXL3030
123Levis 502 Taper Fit Mens Jeans Big E Premium (Actual 33X28) 33X30 Cotton Spandex332929
124Lucky Brand Button Front Shirt Mens Large Linen Orange/Red/Yellow Plaid SSL2828
125Paradise Found Made In Hawaii Hawaiian Shirt Rayon Camp Mens Large LL2727
126Lucky Brand Henley Blouse Womens Large Taupe Short Sleeve Dolman PocketsL2626
127Eddie Bauer Polo Shirt Mens 2XL XXL Orange Pima Cotton Cocona Polyester SS2XL2525
128Verve Ami Cardigan Sweater Womens 3X Rayon Blend Red Open Front Long Sleeve3X2424
129J Crew Mercantile Slim Flex Shirt Mens Large Cotton Spandex Plaid Long SleeveL2222
130Grayson The Hero Button Up Shirt Womens Size 3 (M) Bicycle White Red Long SleeveM2020
131Croft & Barrow Tunic Blouse Womens 1X Rayon Blue Floral Smocked 3/4 Sleeve1X1818
132Livi Dress Womens 18/20 2X Blue Tie Dye Rayon Spandex Maxi Sleeveless2X1616
133JMS Just My Size Blouse Womens 2X 18W 20W Polyester Flare Sleeve Purple Pink2X1414
134Great Northwest Indigo Blouse Womens 2X White Embroidered Short Sleeve2X1212
135C Est 1946 Cato Blouse Womens 26/28W 4X Yellow Pullover Puff Sleeve 3/44X1010
136Eileen Fisher Jumpsuit Womens Large Black Rayon Spandex Pockets Wide Leg ZipL000
137Nike Dri Fit Running Shorts Womens 2X Brief Lined Polyester Black Teal2X88
138Bonobos Button Front Shirt Mens XL Short Blue Cotton Seer****** Standard FitXL66
139Chicos Maxi Dress Womens 0 (US Small, 4) Sleeveless Polyester Spandex LinedS44
140Avenue Shirt Womens 22/24 Purple Crinkle Long Sleeve Button Front Top2422
141JM Collection Button Front Shirt Womens 24W 3X Cotton Purple Floral Sequin V3X00
142Cato Button Front Shirt Womens 18/20W 2X Orange Floral Cotton Short Sleeve2X
143Lane Bryant Womens 24 Button Front Shirt Tie Wrap Belt Blue Cotton Stretch24
Sheet1
 
Upvote 0
I spoke about wanting a few other columns. These are: Category, Gender, Condition

Condition would simply be: If the title contains "NWT", then it is New. If it does not contain "NWT" it is Pre-owned.

Gender is: Womens, Mens, Boys, Girls, Unisex, and blank if none of those are found.

I will begin writing a reply explaining Category next.
 
Upvote 0
Here is info about building the Category column

Categorytransformnotes
TopTops
BlouseTops
TeeTops
TunicTops
KimonoTops
T-ShirtTops
ShirtTops
TankTops
DressDresses
Shirt DressDresses"Shirt Dress" = Dress, and "Dress Shirt" = Tops
JumpsuitJumpsuits
RomperJumpsuits
OverallsJumpsuits
JeansJeans
PantsPants
LeggingsPants
JacketJackets
VestJackets
Sport CoatSport Coats
BlazerSport Coats
Suit JacketSport Coats
Waist CoatSport Coats
SweaterSweaters
CardiganSweaters
ShortsShorts
SkirtSkirts
SkortSkirts
PoloPolosWe need a way around the problem of when it's the brand "Polo Ralph Lauren" or "US Polo Assn" but is also in the polo category
Rugby ShirtPolos
HoodieHoodies/Sweatshirts
SweatshirtHoodies/Sweatshirts
HatMisc
WalletMisc
BagMisc
ScarfMisc

I left off a few misc items because they might be a problem. "Tie" could be a misc item but there are Tops and Dresses with the word "tie" in the title. Maybe "Tie" would only qualify for Misc category IF it was a Mens title.
 
Last edited:
Upvote 0
Which Excel version are you using? Please, update your profile to show which version of Office you are using.

I need to understand more about your data:
  1. Approximately how many rows does the actual data have? More than 10,000 rows?
  2. Does your data consistently use the same letter case? So, you don't have the same words with different cases, such as Tie and tie.
  3. Regarding the Category column, what should happen if there are multiple matches?
 
Upvote 0
Which Excel version are you using? Please, update your profile to show which version of Office you are using.

I need to understand more about your data:
  1. Approximately how many rows does the actual data have? More than 10,000 rows?
  2. Does your data consistently use the same letter case? So, you don't have the same words with different cases, such as Tie and tie.
  3. Regarding the Category column, what should happen if there are multiple matches?
Office 365
  1. More than 10,000 rows. I create about 3500 listing per year and I expect to double or triple that next year. The data comes in on CSV reports and then I transform the data via Power Query.
  2. I capitalize every word in the titles consistently (exceptions would be a typo).
  3. I don't think there will be any multiple matches. If so, maybe 1% of listings. The only thing I could think of is "Shirt Dress" and "Dress Shirt" which mean different things depending on the specific order. There could be multiple matches for the same category. E.g., something like Cardigan Sweater, in which case it would be called Sweater for Category.
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top