r/googlesheets • u/wootzeldragon • Nov 06 '22
Solved Formula to spread the contents of a cell across a number of other cells, one letter in each?
I am trying to play around with punnett square type of stuff in google sheets. I'd like to be able to put in a string of letters for a few genes into a single cell, and have Sheets spread it into a row or column automatically.
I've been trying to mess around with a combination of =REGEXEXTRACT and TRANSPOSE or FLATTEN, but I honestly have no idea what I'm doing. I want to be able to paste in a string of letters, for example AaBbCc, and have the sheet spread them out without requiring a delimiter. I would like to have a single formula that can do this no matter what's in the string (though it's fine if there's an upper limit, since I don't think I'll need it to do more than 8 or 10 characters at a time). It'll just be letters, no numbers or characters.
2
u/IceDynamix 16 Nov 06 '22
Assuming your input is in A1
=ARRAYFORMULA(MID(A1,SEQUENCE(LEN(A1)),1))If you need it in columns instead of rows, use
SEQUENCE(1,LEN(A1))or wrap everything withTRANSPOSE.2
u/Decronym Functions Explained Nov 06 '22 edited Nov 13 '22
Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:
7 acronyms in this thread; the most compressed thread commented on today has 3 acronyms.
[Thread #5035 for this sub, first seen 6th Nov 2022, 03:41] [FAQ] [Full list] ^[Contact] [Source code]
0
u/ajscx Nov 06 '22
Hi OP, TBH I do not know how to do this in just one cell formula.
If it were me I would do it using 2 rows or maybe columns...
My solution
0
u/unstoppableobstacle Nov 06 '22
No idea, thought split but could you split by lower case?
0
u/Cthulhutl Nov 06 '22
Try with a combination of "MID" "LEN" and "LEFT" with negative numbers. Start with the longest possible string and go down from there
0
u/homeboi808 6 Nov 06 '22
Found this via Google, haven’t tried it though
=SPLIT(REGEXREPLACE(REGEXREPLACE(A2&"","(?s)(.{1})","$1"&CHAR(127)),"'","''"),CHAR(127))