r/excel • u/aubviously_ • 3d ago
solved how do i separate "12/13" (for example) into integer value pairs?
I have a dataset that comes in values like "4/4", "12/13", "5/?", etc, always enclosed in quotes and always with a slash in between each value pair. So far I have been able to isolate the numbers and get the first character using LEFT into its own column, but how do I get the first number if it's more than one character? I would also like to get the second value in its own column too, if possible. Edit: using Excel Version 2611
4
Upvotes
•
u/AutoModerator 3d ago
/u/aubviously_ - Your post was submitted successfully.
Solution Verifiedto close the thread.Failing to follow these steps may result in your post being removed without warning.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
9
u/SolverMax 167 3d ago edited 3d ago
Perhaps:
Or, if the ? is literal:
14
u/UserBeware333 3d ago
Just use Text to Column button with the delimiter set to /, will do all the work for you
3
u/tinygiggs 3d ago
Leave colums to the right, then go to Data, Text to Columns, Delimited, and then select other and type / into the box.
2
u/xNaVx 12 3d ago
=REGEXEXTRACT([cell],"\d+",1)*11
u/TwoPointEightZ 3d ago edited 3d ago
I would get the two numbers by doing a SEARCH or FIND to learn the position of the / in the string. Then use that position number in a MID formula to extract the number up to the / to get the first number, and another MID to get everything after the / to get the second number. In other words, your MID formula will contain the SEARCH/FIND formula inside it.
If the data is messy, like it almost always is, you can TRIM it, you can remove " with REPLACE or shave it off the end with RIGHT. I would probably have several helper columns with these formulas to work it all out, and then at the very the end, two columns that turn the text of the first and second numbers into usable numbers with VALUE.
1
u/Decronym 3d ago edited 3d ago
Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:
Decronym is now also available on Lemmy! Requests for support and new installations should be directed to the Contact address below.
Beep-boop, I am a helper bot. Please do not verify me as a solution.
[Thread #49765 for this sub, first seen 30th Nov 2026, 01:14] [FAQ] [Full list] ^[Contact] [Source code]
1
u/machusassistant 3d ago
Since you're on Excel 2611, TEXTBEFORE and TEXTAFTER are the simplest fit: =TEXTBEFORE(A1,"/") returns the first number and =TEXTAFTER(A1,"/") returns the second, however many digits each side has. If the quote marks are actually in the cell, strip them first with SUBSTITUTE, e.g. =TEXTBEFORE(SUBSTITUTE(A1,"""",""),"/"). The results are text, so wrap them in VALUE() if you want to calculate with them — just note VALUE() will error on the "?" entries.
1
u/Conscious-Solid331 3d ago
With value in A1
B2 =Left(A1,2,Find("/",A1) -1)
And something like that for the right side, using MID
or SUBSTITUTE(A1,B1&"/","") is easier
1
u/dspayr 3d ago
The new REGEX functions in Excel will let you extract them easier than before. Here’s a TikTok series of four vids where the guy gives examples of how to do it.
https://www.tiktok.com/t/ZTP3HtgB9/