Home > Software engineering >  json parse. Extract 2 values from multiple records and merge into one cell, with array formula
json parse. Extract 2 values from multiple records and merge into one cell, with array formula

Time:06-07

I'm trying to use a formula to extract the values from each "hash" in table cells A1:A and concatenate them in cells B1:B separated by commas

enter image description here

CodePudding user response:

Use regexextract(), like this:

=arrayformula( 
  textjoin( 
    ",", 
    true, 
    iferror( 
      regexextract( 
        query( 
          transpose( split(A1, "," & char(10), true, true) ), 
          "where Col1 contains 'hash' ", 0 
        ), 
        "hash"":""(\w )"
      ) 
    ) 
  ) 
)
  • Related