r/googlesheets • u/FireDracon • 3d ago
Waiting on OP Split Row into Multiple Rows
Was wondering if theres a way to a row with data into multiple rows. Some of my dads data got merge into 1 row and we want to spli the row without have to re type the data. Also my bad is stupid when comes to computers hes almost 80. So was just wondering if theres is a way to do that.
So for example Row 5 has 3 names dates payments, but we want each of those in their own row, how do we do that with out deleting everything in row 5 and just put everything in its own row.
No thats not the real data thats just stupid quick example i made. my dads daya is a bit more. then that,
1
u/HolyBonobos 3124 3d ago
Probably not in a way you'd consider satisfactory, at least not natively. Working with the data shown in the screenshot, you could split out the entries into a new dynamic range with a formula like
=QUERY(WRAPROWS(TOROW(BYROW(A2:D7,LAMBDA(i,TOROW(INDEX(SPLIT(TRANSPOSE(i),CHAR(10))),,1)))),4),"WHERE Col1 IS NOT NULL LABEL Col1 'Name', Col2 'Date', Col3 'Owed', Col4 'Paid' FORMAT Col2 'mm/dd/yy', Col3 '$0', Col4 '$0'"). This would read the "messed-up" data and use it to automatically create a "clean" dataset in a different part of the file (assuming line breaks are consistently used to separate entries within the same cell), and would update as changes are made to the editable range.Do note, though, that the editable range would remain the one with the "messed-up" data. Attempts to directly edit the entries in the "clean" data created by the formula would prevent it from expanding and break it, resulting in a
#REF!error. You could change the formula output into a new editable range by copy-pasting values (Ctrl+C then Ctrl+Shift+V) and deleting the original data, but this would only really serve as a temporary fix and would not prevent future mistakes. You could do some data validation to put up some roadblocks for predictable errors, but when the underlying problem is the user behaving in unexpected and improper ways, there's only so much you can do about it.1
u/AutoModerator 3d ago
/u/FireDracon Posting your data can make it easier for others to help you, but it looks like your submission doesn't include any. If this is the case and data would help, you can read how to include it in the submission guide. You can also use this tool created by a Reddit community member to create a blank Google Sheets document that isn't connected to your account. Thank you.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/AdministrativeGift15 370 2d ago
Try this:
=INDEX(REDUCE(A1:D1,SEQUENCE(COUNTA(A:A)-1,1,2),LAMBDA(t,c,VSTACK(t,TRANSPOSE(SPLIT(TRANSPOSE(INDEX(A:D,c,)),CHAR(10)))))))You'll just need to apply the correct date format to column B afterwards.
1
u/One_Organization_810 736 2d ago edited 1d ago
Try this one in an empty area. Expand as needed.
Assuming this is just a one time fixing operation, just copy the results back over the source and then delete the formula.
=reduce(tocol(,1), A2:D, lambda(stack, data,ifna(vstack(stack, index(split(data, char(10)))))))1
u/djpresstone 2d ago
In A8, a9, a10: =index(split(a5, char(10)), 1, row()-7)
Then just copy to b, c, & d and bob’s your uncle
0
u/carbonizedtitanium 28 2d ago edited 2d ago
Assuming that all the "defective" rows are the same (i.e. it's just the data separated by a newline char and all columns in the same row have the same amount of newlines), you can use GAS script to automatically split all rows that contain newline chars into individual rows:
go to Extensions >> Apps Script >> replace the default text with the following script, replace the sheet tab name with the name of your own tab name, and save. then click Run and follow the instructions to allow permissions for the script to run.
P.S. To avoid the same problem from happening, i suggest you create a Google Forms file and link it to the spreadsheet. Use the Google Forms to log transactions into the spreadsheet, instead of directly entering the data into the sheet. using Google Forms to enter the data prevents the problem that you currently have.
ideally, your Google Forms should ask:
with the data from the Form, you can then create a Dashboard tab of what is (or was) owed and how much, using formulas.
-3
u/TRI140dot6 3d ago
PAYED should be PAID
0
u/[deleted] 21h ago
[removed] — view removed comment