Forum Discussion

Sandeeep's avatar
Sandeeep
Brass Contributor
Apr 09, 2022

Obtain data from a cell with lots of paragraphs

Cool, So I have multiple questions I need help with regarding formulas and macros.

 

ok, So I have a cell that contains paragraphs of text. Imagine I'm a teacher, and each student gave multiple paragraphs of text. Column A has the student's name, column B has the text.

(Row 1 is title/headers ofc)

 

Ok, now everything regarding column B.

 

1. Need the formula to find a specific word in the cell, provide it True/False if found. (in column C).

2. Then, how many times that specific word in the cell was found. (eg, how many times the word "the" was in the cell". (count of matches in Column D) (this can be dynamic, eg, Change a lookup cell with words, or a range of cells to lookup. like, finding the word "all" "therefore" "the" "hence" and give a total count or individual count of it all.

3. Super hard? So now imagine the paragraph is a theater script. with what the person says is followed by ":"

(eg, John: howdy partner!" Lisa: g'day Aaron: Hello y'all everyone John: Hello y'all, nice to meet everyone finally)

 

Here, I'll have a cell (or range of cells like in (2.)) to look up. Say this word is "Hello".

And I want the output to be the sentence/utterance that preceded it till the match on ":". With its multiple matches.

 

Thus the output of this formula would search the keyword "Hello y'all" (case insensitive) and provide the output.

g'day

Hello y'all everyone

(these are separated by a newline/enter key)(or separated by commas, cause I can use "find and replace" to change all commas to newline anyways)(in the same cell)

 

same cell output cause I have multiple students and I need it for each student individually, and there are 500-1000 students usually in the workbook, a new batch of students every day.

 

4. Finally, If possible, a macro to quickly do all this, but the output is on a neat and clean new sheet.

 

 

 

 

  • Sandeeep 

    If you want the function to be available in all workbooks, store it in a module in an add-in or in your personal macro workbook PERSONAL.XLSB.

     

    Is the attached version better?

    • Sandeeep's avatar
      Sandeeep
      Brass Contributor
      TYSM, the text.xlsx file has the exact similar kind of data I have, (mine is 500-100 everyday) and I got like 9 such per day.

      I had the solution for 1. I'm so thankful for the Frequency thing. It's exactly what I needed.

      ty ty ty ty

      Any ideas for 3? I've been googling for 2weeks with random stuff, but none seem to be exactly what I need. Would love for getting a formula for that!

      I can do 4. record macro myself, so that's fine. Hoping someone can solve 3. for me

Resources