partial text frequency counting

losc

New Member
Joined
Oct 21, 2021
Messages
1
Office Version
  1. 2016
  2. 2007
Platform
  1. Windows
Hey there! I am trying to count the frequency a certain diagnosis (adenoma) is found within a report. The problem is that sometimes the report contains no adenoma found of no polyp or adenoma found, this can be worded in various ways. The data base I am using is extremely large so I cannot check everything manually. I made a fictive worksheet to showcase the problem you can see below.
My current formula is;=SUMPRODUCT(ISNUMBER(SEARCH("no* adenoma";TRIM(MID(SUBSTITUTE($B3;":";REPT(" ";LEN($B3)));(ROW($B$1:$B$10)-1)*LEN($B3);LEN($B3)))))+0) however this does not seem to work consistently for either formula. The adenoma formula is pretty much the same just with different ranges and no* removed. I don't really understand why the wildcard does not work.

Any tips on how to solve this? Thanks in advance!

forum sample adenoma.xlsx
ABCDEF
1number ReportAmount of adenomasAmount of no adenomasmanual count adenoma freqmanual count no adenoma freq
21Colonoscopy: biopsy performed 50 cm from anus. No polyp or adenoma. Tubulovillieus adenoma in biopsy 2. Biopsy 3 hyperplastic polyp. No adenoma. 1112
32Fragemented hyperplastic polyp. No adenoma.0001
43Villieus adenoma in 1. No polyp. Biopsy 2 no polyp or adenoma. Biopsy 3 no adenoma or polyp0012
54I: Tubular adenoma low grade dysplasia II: biopsy 75 cm from anus: tubular adenoma low grade dysplasia III: Tubular adenoma low grade dysplasia IV: Tubular adenoma low grade dysplasia V: biopsy 60 cm from anus. No polyp or adenoma. VI: biopsy 50 cm from anus. hyperplastic polyp no adenoma. 6242
65sessile laesion. 50 cm from anus0000
76Biopsy 40 cm from anus. Adenocarcinoma, no other polyps0000
87I: Tubular adenoma low grade dysplasia II: no polyp or adenoma III: adenoma undefined IV: hyper plastic polyp, no adenoma4222
98tubulovillieus adenoma in 1. Hyperplastic polyp in 2, no adenoma. No polyp or adenoma in 4. 0012
109Infectious activity in 10000
1110I: Membrane biopsy coecum: tubulovillieus adenoma with low grade dysplasia. II: Polypectomy: tubular adenoma low grade dysplasia. Diamiter polyp 0,5 cm III: Polypectomy 80 cm from anus. Tubulovilieus adenoma low grade dysplasia; diameter polyp 1,5cm. IV: Biopsy membrane: No abnormalities (no polyp or adenoma)4131
Sheet1
Cell Formulas
RangeFormula
C2:C11C2=SUMPRODUCT(ISNUMBER(SEARCH("*adenoma",TRIM(MID(SUBSTITUTE($B2,":",REPT(" ",LEN($B2))),(ROW($B$1:$B$10)-1)*LEN($B2),LEN($B2)))))+0)
D2:D11D2=SUMPRODUCT(ISNUMBER(SEARCH("no* adenoma",TRIM(MID(SUBSTITUTE($B2,":",REPT(" ",LEN($B2))),(ROW($B$1:$B$10)-1)*LEN($B2),LEN($B2)))))+0)
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Welcome to the MrExcel Message Board!

Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at: Partial text frequency counting in reports [SOLVED]
If you have posted the question at more places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
 
Upvote 0

Forum statistics

Threads
1,214,978
Messages
6,122,545
Members
449,089
Latest member
davidcom

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