Categorizing text data

Shadowsliver

New Member
Joined
Dec 30, 2017
Messages
3
Hi,

I have trouble with categorizing large amounts of text data for my home economy overview.

So I have a table with text strings (column A) and numbers (column B), and I will create a table with "search words" for the different categories I want to make, similar to this example:

ABCDEFGH
1TextAmountCategory
2Apple1FruitsVegetablesBerries
3More Apple12AppleCarrotberry
4Carrot3BananaTomato
5Blueberry5
6Carrot2
7Apple5
8Lingonberry8

<tbody>
</tbody>

What I want to do, is primarily to have a function find how many fruits there are, how many vegetables and how many berries. Like the bold summary shown below.
Most of the time it will not be an exact string match (so the function needs to find a matching fragment, "berry" in blueberry for instance).


ABCDEFGH
1TextAmountCategory
2Apple1FruitsVegetablesBerries
3More Apple12AppleCarrotberry
4Carrot3BananaTomato
5Blueberry5
6Carrot2Summary
7Apple5Fruits18
8Lingonberry8Berries13

<tbody>
</tbody>

I have struggled to find the right function to be able to use strings from one matrix to categorize strings in another matrix to the summarize, for each category, the numbers associated with the strings.

Any help would be much appreciated, thanks in advance!
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
A
B
C
D
E
F
G
H
1
TextAmountCategory
2
Apple
1​
FruitsVegetablesBerries
3
More Apple
12​
AppleCarrotberry
4
Carrot
3​
BananaTomato
5
Blueberry
5​
6
Carrot
2​
Summary
7
Apple
5​
Fruits
18​
8
Lingonberry
8​
Berries
13​
9
Vegetables
5​

<tbody>
</tbody>

E7=
SUMPRODUCT(SUMIF($A$2:$A$8,"*"&$F$3:$F$4&"*",$B$2:$B$8))

E8=SUMIF($A$2:$A$8,"*"&H3&"*",$B$2:$B$8)


E9
=SUMPRODUCT(SUMIF($A$2:$A$8,"*"&G3:G4&"*",$B$2:$B$8))

 
Last edited:
Upvote 0
Thanks for assisting. However, I cannot get the suggested formel to work, I get an error message about this passage: "*"&F$3$:$F$4&"*"
 
Upvote 0
You might want to consider using a well-known file sharing facility such as DropBox instead of some unknown file sharing facility like the one you used. When I downloaded your file, a second file was downloaded with it which my Norton anti-virus software identified as a thread and removed it. Given that, I deleted the copy of your file as well as I don't know what the site you used may have done to it.
 
Upvote 0

Forum statistics

Threads
1,216,075
Messages
6,128,665
Members
449,462
Latest member
Chislobog

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