Forum Discussion

Mark_Dekeyser's avatar
Mark_Dekeyser
Copper Contributor
Nov 25, 2022
Solved

Erase words (from a dictionary) in paragraphs across multiple cells

Hi all,   I have two sources in two tables: - a dictionary in column A containing a list of dictionary words (between 100 and 1000 words) - a list of cells in column C containing copied text info...
  • Patrick2788's avatar
    Patrick2788
    Nov 25, 2022

    Mark_Dekeyser 

    'e' is assigning a name to a parameter in the array that MAP will check.  Essentially, what MAP allows you to do is to perform a calculation on each 'element' in an array.  If you study MAP, you may also look into the functions mentioned here:

    Announcing LAMBDA Helper Functions (microsoft.com)

     

    I've updated the sample to account for those anomalies.  CheckWords is a LAMBDA designed to pull out words found in Column A.

     

     

    'CheckWords
    'This function 'explodes' a cell converting it to an array.  MAP replaces words found in the Words list with a blank.
    =LAMBDA(element,TEXTJOIN(" ",,MAP(TEXTSPLIT(element, " "), LAMBDA(word, IF(ISNUMBER(XMATCH(word, words)), "", word)))))

     

      

    CheckWords is then run on each 'element' within the paragraphs array.

     

    =MAP(paragraphs,LAMBDA(e,CheckWords(e)))

     

     

Resources