问题
I'm trying to split one row in Google Sheets into different rows depending on its content. Here's an example:
Name | Ticker | Categories
Bitcoin | BTC | currency; store-of-value; trust layer; smart contracts; cross-industry
Ripple | XRP | currency; cross-industry
Into:
Name | Ticker | Categories
Bitcoin | BTC | currency
Bitcoin | BTC | store-of-value
Bitcoin | BTC | trust layer
Bitcoin | BTC | smart contracts
Bitcoin | BTC | cross industry
Ripple | XRP | currency
Ripple | XRP | cross-industry
How can I do this using a script or any other tools?
回答1:
=ARRAYFORMULA(TRIM(SPLIT(TRANSPOSE(SPLIT(QUERY(TRANSPOSE(QUERY(TRANSPOSE(
IF(IFERROR(SPLIT(C1:C, ";"))<>"", "♥"&A1:A&"♦"&B1:B&"♦"&
IFERROR(SPLIT(C1:C, ";")), )),,999^99)),,999^99), "♥")), "♦")))
来源:https://stackoverflow.com/questions/56420002/how-to-automatically-split-one-row-into-different-rows-in-google-sheets