functiongoogle-sheets

This LET formula outputs data in 2 columns. I want to instead output it to 3 columns with a blank column b/w the two data columns


I'm in google sheets. I wrote a formula that outputs data into two columns. I am hoping to essentially insert a blank column between as ultimately the first column will get merged with the 2nd column. I have tried using an output variable and then nesting and two index functions referring each to filterstatus between {} but with no luck. Any ideas? I'm trying to keep the formula as dynamic as possible.

    =LET(
      filtertype,
        IFERROR(SORT(IFNA(FILTER({Set[CardName], CHOOSE(MATCH(G52,{"All","Base","Master"},0),Set[AllOwn],Set[BaseOwn],Set[MasterOwn])},Set[Player]=F42),"No Match"))),
      filterstatus,
        ArrayFormula(IFNA(IF(G53="All", filtertype, FILTER(filtertype,INDEX(filtertype,0,2)= G53)), "Blank")),
      filterstatus
    )

Solution

  • You can try:

    =LET(
      filtertype,
        IFERROR(SORT(IFNA(FILTER({Set[CardName], CHOOSE(MATCH(G52,{"All","Base","Master"},0),Set[AllOwn],Set[BaseOwn],Set[MasterOwn])},Set[Player]=F42),"No Match"))),
      filterstatus,
        ArrayFormula(IFNA(IF(G53="All", filtertype, FILTER(filtertype,INDEX(filtertype,0,2)= G53)), "Blank")),
      QUERY(filterstatus,"SELECT Col1, 0/0, Col2 LABEL 0/0 ''")
    )
    

    Or

    =LET(
      filtertype,
        IFERROR(SORT(IFNA(FILTER({Set[CardName], CHOOSE(MATCH(G52,{"All","Base","Master"},0),Set[AllOwn],Set[BaseOwn],Set[MasterOwn])},Set[Player]=F42),"No Match"))),
      filterstatus,
        ArrayFormula(IFNA(IF(G53="All", filtertype, FILTER(filtertype,INDEX(filtertype,0,2)= G53)), "Blank")),
      IFNA(HSTACK(INDEX(filterstatus,,1),,INDEX(filterstatus,,2)))
    )