Fill out columns based on reference table

dommeehan

New Member
Joined
Aug 10, 2020
Messages
15
Office Version
  1. 365
Platform
  1. Windows
Hi,

I want to clean some data I have received. It is webscrape data and all the data has arrived in the item column and I want to split this out to find the sex of the item (mens, womens, N/A) and what categories and sub categories they lie in.

I need a formula in the sex column that searches the item column to see if it contains "mens" or "womens" and then posts that as a value. If the cell doesn't contain mens or womens it should post N/A.

I then want a formula in category 2 column that searches the item column and matches a product word (cap, jacket, pack etc) to one in the reference table and posts it.

I then want a formula in category 1 column that searches the item column and matches it to an item in the reference table and posts which category the item is in. This value can be apparel, pack, sleeping bag, or accessory (see reference table).

Please let me know if that doesn't make sense.

I have filled in the first 3 rows, but as my data contains thousands of rows I'm looking for a quick way to do this.

Any help greatly appreciated.

Book1
ABCDEFGHIJKLMN
1ItemPriceSexCategory 1Category 2Category 3ApparelPackSleeping BagAccessory
2Blue denim pant mensMensApparelPantJacketRucksackSleeping BagCarabina
3Down Jacket pink womensWomensApparelJacketPantPackBiviHeadband
435L rucksackN/APackRucksackShortWaist packShelterCap
5Nylon short greenTeeHat
6Nylon short yellowTshirtGaiter
7White shell jacketBootBeanie
8Green shell jacketBase-layer
9Orange track pantMid-layer
10White walking boots
11Sleeping bag blue -5
12Waterproof gaiter
13Blue base-layer
14Yellow gaiter
15Green denim pant
16Blue waist pack
176 Panel cap
1825L rucksack green
19Red base-layer
20Sleeping blue -15
21Black shell jacket
2225L rucksack red
23Double bivi
24Yellow denim pant
25Sleeping bag pink -15
26White headband mens
27Black headband mens
28Green gaiter
29Blue headband mens
30Sleeping bag pink -10
31Pink base-layer
32Pink headband womens
33Orange headband womens
34Sleeping bag -25
35Blue headband womens
36Purple base-layer
37Orange base-layer
3825L rucksack orange
39Sleeping bag blue -10
40Snapback cap
41Sleeping bag -35
42Single bivi
43Wool beanie
44Group bivi
45Single shelter
46Double shelter
47Sleeping bag pink -5
48White base-layer
Sheet1
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
from where are u donloading data to column A?
is there any other info available?
From 5 to 8th row there is no male / female indicator.
 
Upvote 0
from where are u donloading data to column A?
is there any other info available?
From 5 to 8th row there is no male / female indicator.
I scraped it from the web. This is a sample so I can see what formulas I need to create which I can then apply to my actual data.

If there is no mens or womens indicator it should post "N/A" as explained in my original query.

Thanks
 
Upvote 0
I'm not sure if it's doable with the provided sample. there is no specific distinction in that column.

I don't see any way I could assign from C to F columns based on that column alone.
that's why I asked for the website from where you took data. Maybe there is a different solution or more data available.
 
Upvote 0
Try using the formula below for cell C2 and if it does what you want, then apply the formula to the rest of the cells.
Excel Formula:
=IF(COUNTIF(A2,"*mens*")>0,IF(COUNTIF(A2,"*womens*")>0,"Womens","Mens"),"N/A")
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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