SheetRocks
Documentation/Formulas/TAG

TAG

Converts a 2-column key|value table (default) or 2-row key|value table into a single JSON tag object.

Syntax

TAG(table, [orientation])

Arguments

Argument Description Required
table For rows (default): Nx2 table with keys in column 1 and values in column 2. For columns: 2xN table with keys in row 1 and values in row 2. Required
orientation Optional. row/rows (default), column/columns, TRUE/FALSE, or 1/0. Optional

Examples

Vertical key|value list (default rows orientation)

=TAG(A1:B3)
Result ⇒ {"Name":"John","Age":"25","City":"NYC"}
A B
1 Name John
2 Age 25
3 City NYC

Horizontal key|value pair (columns orientation)

=TAG(A1:B2, "columns")
Result ⇒ {"Product":"Widget","Price":"9.99"}
A B
1 Product Price
2 Widget 9.99

Related Functions

Other Special Functions & Keywords functions:


← Back to Formula Reference