Home > database >  How can I split this dataset by "|" but keep it in one column in Sheets?
How can I split this dataset by "|" but keep it in one column in Sheets?

Time:04-27

I'm trying to use SPLIT() here, but it only gets the first row: Notice that the ranges are obtained dynamically, so that moving columns around won't lose the colum reference:

=ARRAYFORMULA(
INDIRECT("Sheet1!"&REGEXEXTRACT(ADDRESS(5,MATCH("PO #",Sheet1!$5:$5,0)),"[A-Z] ")&"5:"&REGEXEXTRACT(ADDRESS(5,MATCH("PO #",Sheet1!$5:$5,0)),"[A-Z] "))&"|"&
INDIRECT("Sheet2!"&REGEXEXTRACT(ADDRESS(5,MATCH("PO #",Sheet2!$5:$5,0)),"[A-Z] ")&"5:"&REGEXEXTRACT(ADDRESS(5,MATCH("PO #",Sheet2!$5:$5,0)),"[A-Z] ")))

This generates, which is not the end result:

enter image description here

The idea is to split it by the | and stack them up and avoid blanks.

Here's a sample of the data: enter image description here


update:

=INDEX(QUERY({
 INDIRECT(   "Orders!"&ADDRESS(6, MATCH("PO #",    Orders!5:5, ))&":"&SUBSTITUTE(ADDRESS(2, MATCH("PO #",    Orders!5:5, ), 4), 2, ));
 INDIRECT("Scenarios!"&ADDRESS(6, MATCH("PO #", Scenarios!5:5, ))&":"&SUBSTITUTE(ADDRESS(2, MATCH("PO #", Scenarios!5:5, ), 4), 2, ))}, 
 "where Col1 is not null", ))

enter image description here

  • Related