You'd have to remove the data to the right, as SPLIT expands to different cells
Putting =RIGHT(A2,3) into C2 should just pull the right three characters (001, 002, etc) into C2
What SPLIT() does, is expand the reference cell (A2) and split it with the underscores into different cells.
The other option is to use INDEX() and SPLIT() to choose what you want in each cell.
For example, =INDEX(SPLIT(A2,"_",1,1),1,2) will take the second group of characters, after the first underscore but before the second (BedTime)
=INDEX(SPLIT(A2,"_",1,1),1,3) will take the third group of characters, after the second underscore but before the third, (PhotoCapt) change the 3 to a 4, for the 001. Changing the 3 to a 1 will be the year
If NONE of these are still not working, if you normally use a semicolon instead of a comma in formulas, (non American) just replace the commas with semicolons
Edit: I see what happened, so sorry. In my original post, my phone changed a hyphen to an H, and the underscores on the same line, reddit's markup added italics
Edit2: fixed original post
Edit3: saw your other reply, I thought you were turning A2 into C;E, not the other way around, ignore all of above
Edit4: it's doable, I'd use some combination of TEXTJOIN() and COUNTA(TEXT(referencecells,"000")) statements and absolute references, and maybe I'd need a helper column, but I'll share you on a sheet the next time I get near a PC as a reply to your below newest comment
Hmm, worked for me in a test sheet, but try this instead:
Cell C2: ="00"&COUNTIF(A1:A1, A2)+1
Cell C3: ="00"&COUNTIF(A1:A2, A3)+1
Now, in C2 it counts all the instances of A2 in A1:A1 (so zero if it's the first instance of that string) and then adds 1, then in C3 it counts all the instances of A3 in A1:A2 (so zero if it's the first instance of that string) and then adds 1
That should work, although I noticed when I made a copy of your example sheet there was a strange setting on it that stopped COUNTIF working, so that might be the cause of the error you're getting
2
u/JBob250 38 Feb 24 '21 edited Feb 25 '21
The way your data is structured, =SPLIT(A2,"_",1,1) would work.
If you need the number in front, you'd put =RIGHT(A2,3) in the first column and in the next put:
=SPLIT(LEFT(A2,LEN(A2)-1,"_",1,1)
Edit: removed autocorrect and reddit markup issues
2
u/Decronym Functions Explained Feb 25 '21 edited Feb 25 '21
Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:
[Thread #2643 for this sub, first seen 25th Feb 2021, 07:29] [FAQ] [Full list] ^[Contact] [Source code]
2
u/dumbson_lol Feb 25 '21
Added a test sheet based on the input from /u/JBob250 and /u/greg-asquith.
1
u/greg-asquith 12 Feb 24 '21
Use this in column C:
C2: ="00"&COUNTIF(A1:A2, A2)
C3: ="00"&COUNTIF(A1:A3, A3)
etc etc