Extracting Text from Multiple Occurrences in AppSheet Formula

Hello,

I am trying to create a formula for my app that serves to extract specific text. The text I'm interested in is located between asterisks (*), for instance, if I have the text "*Me* using *AppSheet*" in column [Ressalvas], I would like the formula to extract only the words "Me" and "AppSheet," as those are the ones I placed between the asterisks. For now, I have a formula that only works for the first text enclosed by asterisks, and not for all occurrences. In the example I provided, it only extracts the text "Me" using the formula below:

INDEX(
  SPLIT(
    SUBSTITUTE(
      SUBSTITUTE([Ressalvas], "*", "|"),
      "|",
      " | "
    ),
    " | "
  ),
  2
)

 

Thanks,

Daniel

0 6 206
6 REPLIES 6

Please try 

SUBSTITUTE(EXTRACTHASHTAGS(SUBSTITUTE([Ressalvas],"*","#")),"#"," ")

 

The solution assumes that there will never be  hashtag  "#" in the column [Ressalvas]

EXTRACT() - AppSheet Help

 

 

Thanks, i didn't knew this formula existed.

You are welcome.

Please keep the following AppSheet functions list handy.

AppSheet function list - AppSheet Help

 

Unfortunately, the formula fails when there are spaces, for example, if I write "*Hello everyone*", it only extracts the "Hello", and my language (Brazilian Portuguese) has accents that the formula also doesn't read, like "à, ó, ç".

Oh okay. Your original post's examples did not mention multiple words in a single group within asterisks(*)  and also about language accents.

Anyway, no problem, I will post back if I come up with something about multiple words. You could also explore extract functions more.🙂

However if the EXTRACT() functions do not recognize certain language accents as you mentioned, then I am sorry, I too have no suggestion on that aspect.

 

I believe the below expression will take care of multiple words with spaces between them or single words. But it will not take care of first word in the string being included in asterisks or there being commas between words in  asterisks. But you can modify the expression for such requirements. I have of course not tested for accents as you mentioned.

SUBSTITUTE(SUBSTITUTE(EXTRACTHASHTAGS(SUBSTITUTE(SUBSTITUTE([Ressalvas]," *","#"), " ","999")),"999"," "),"#","")

 

 

Top Labels in this Space