Home > Mobile >  Splitting Text and Formatting it - Google Sheets
Splitting Text and Formatting it - Google Sheets

Time:01-15

I have a log file with three fields, the first two are userIDs and the third is an item description. Can I use a single formula to Split the text, format the first 2 items, and leave the 3rd alone?

Sample Data: <@!9812391203019>; <@!98120319283> ; Short Description

Formula Currently used: =ARRAYFORMULA(REGEXEXTRACT(TRIM(SPLIT(A3,";")),"[0-9] "))

This works to extract the userID from the unneeded in the first two columns but will only give me numbers for the third.

Previous Formula was within the REGEXEXTRACT but it left the unneeded "<@!" and ">" in the columns which I wanted to remove.

Any help and suggestions would be appreciated! Thanks in advance!

CodePudding user response:

try:

=INDEX(IFERROR(REGEXREPLACE(TRIM(SPLIT(A1:A5, ";")), "[@!<>]", )))

enter image description here

CodePudding user response:

Does this work?

=Split(RegexReplace(A1,"[<@!>]",),"; ",0)

enter image description here

  •  Tags:  
  • Related