Excel Magic: Table to JSON with a Formula! #excel #microsoftoffice #dataextractor #excelformula

preview_player
Показать описание
Learn how to convert any Excel table into a JSON array using a single dynamic formula — no coding, no VBA, just pure Excel magic! 💥📊

You can also do the same with other options like
1. Power Query (No Code, Built-in Tool)
2. VBA Macro
3. Python (with pandas)
4. Online Tools

Let me know if you want to see that too.
Note: Use angled brackets in FILTER

Formula used in this example:
=LET(
headers, A1:D1,
data, FILTER(A2:D8, A2:A8 [gt-lt] ""),
rowCount, ROWS(data),
jsonRow, LAMBDA(i,
LET(
row, INDEX(data, i, SEQUENCE(1, COLUMNS(headers))),
jsonFields, TEXTJOIN(",", TRUE,
CHAR(34) & INDEX(headers, 1, 1) & CHAR(34) & ":" & CHAR(34) & INDEX(row, 1) & CHAR(34),
CHAR(34) & INDEX(headers, 1, 2) & CHAR(34) & ":" & CHAR(34) & INDEX(row, 2) & CHAR(34),
CHAR(34) & INDEX(headers, 1, 3) & CHAR(34) & ":" & CHAR(34) & INDEX(row, 3) & CHAR(34),
CHAR(34) & INDEX(headers, 1, 4) & CHAR(34) & ":" & CHAR(34) & INDEX(row, 4) & CHAR(34)
),
"{" & jsonFields & "}"
)
),
allRows, TEXTJOIN(",", TRUE, MAP(SEQUENCE(rowCount), jsonRow)),
"[" & allRows & "]"
)
Рекомендации по теме
welcome to shbcf.ru