Keep Empty Fields When Splitting Text in Google Sheets
Add FALSE as the fourth argument of SPLIT to keep empty fields between delimiters. Set the third argument to FALSE as well when a multi-character separator should be treated as a single token. Try the formula on one sample row before expanding it.
1. Read one raw value beside its expected columns
Imagine cell A2 holds Ops||Tuesday and the expected columns are team, owner, and day. The consecutive pipes represent an empty owner. In a clear result area enter =SPLIT(A2,"|",FALSE,FALSE). Check that Ops is followed by an empty cell, then Tuesday. Leave room to the right for the result to expand.
2. Separate the meaning of the two optional flags
The third argument determines whether each character in the separator can act individually. For example, an exporter using ~| might include lone pipes within an ordinary note. Use the whole token as the delimiter when that matches the format. The fourth flag determines whether adjacent delimiters collapse where an empty value sits. In a row with a missing optional field, this choice determines the column alignment.
3. Confirm the export format before batch use
Take three synthetic samples representing all fields filled, one missing middle field, and two consecutive missing fields. Count the result positions and compare them with the file specification. If values can include the same delimiter as data, especially when the format uses quoting, a simple SPLIT can break the record. Use the exporter’s documented import option for quoted fields and compare a few original rows after import.
댓글
댓글 쓰기
안녕하세요 :)