excel text to column delimiter starting from end of the row - excel

I have strings in a column that look like this
/name/safsdf/231232/asesa/filename.mp4
/ds2/sasdsfsdf/2fd32/a234sa/filenameb.mp4
...
...
so text to column works great i can easily make a column that has just the filenames without the folders.
My problem is its inconsistent.
so some rows have more or less than 5 / which screws up the column.
For example:
/name/safsdf/231232/asesa/filename.mp4
/ds2/sasdsfsdf/2fd32/a234sa/filenameb.mp4
/ds3/123/12321/123/123/filenamec.ts
...
will result in the last column being:
filename.mp4
filenameb.mp4
123
I'm looking for the result to be:
filename.mp4
filenameb.mp4
filenamec.ts
Is there a way to do text to colum in reverse where it starts looking for delimiters at the end of the row?
This will give me a list of proper filenames

You already have an answer. Here is one more approach:
=TRIM(RIGHT(SUBSTITUTE(A1,"/",REPT(" ",99)),99))

What you want is a reverse string search to grab everything to the right of the last "/".
The formula (assume one of your strings is in A1) would be
=IF(ISERROR(FIND("/",A1)),A1,RIGHT(A1,LEN(A1)-FIND("~",SUBSTITUTE(A1,"/","~",LEN(A1)-LEN(SUBSTITUTE(A1,"/",""))))))
Take a look at this answer and this site for an explanation of why this works.

Take a copy and Replace */ with nothing.

Related

reformat excel text column to specific format

I have a column in my excel that includes authors name and it looks as follows:
My goal is to remove the dates + the last comma from all of these rows to make it something like this:
Is there a way I can do it in excel?
Based on your example, in which there are multiple commas in one cell, I would go with determining the position of the last comma first (in order to know where to slice the content of said cell). Then it's a matter of IF formula based on condition in which the last 4 characters in the cell are digits:
=IF(ISNUMBER(VALUE(RIGHT(A1,4))),LEFT(A1,FIND("#",SUBSTITUTE(A1,",","#",LEN(A1)-LEN(SUBSTITUTE(A1,",",""))))-1),A1)
FYI: The "#" substitution is targeted at knowing exactly where the last comma occurs in the cell. Any other unique, not-appearing-in-the-string character would have done the same job.
I've tested the formula on below examples:

How to get the unique value from a cell which repeats multiple times in excel?

Hi All i have a data of around 50000 candidates and one of the column contains the subject like below .
I want a formula in Column B to get the Unique Value from column A.
If all the values in "," are same then i need the Single value else all the cell Data.(There may be multiple comma separated entries)
I tried find formula but is not working.
Thanks in Advance.
This will work for any number of comma-separated entries:
=IF(REPT(LEFT(A2,FIND(",",A2&",")),1+LEN(A2)-LEN(SUBSTITUTE(A2,",","")))=A2&",",LEFT(A2,FIND(",",A2)-1),A2)
Regards
Bit of a mess but this will work:
=IF(ISNUMBER(SEARCH(MID($A2,1,SEARCH(",",$A2,1)-1),$A2,LEN(MID($A2,1,SEARCH(",",$A2,1)-1)))),IF(ISNUMBER(SEARCH(MID($A2,1,SEARCH(",",$A2,1)-1),$A2,LEN(MID($A2,1,SEARCH(",",$A2,1)-1))*2)),MID($A2,1,SEARCH(",",$A2,1)-1),$A2),$A2)
If search finds the first word again past the length of it it checks again past double it's length. If that's a match it returns just that word and otherwise returns the entire cell.
I will keep trying to find a more elegant solution but for now, this'll do. Well providing you are always searching on an index of 3. If you aren't I can still do it but would like to use helper columns (or have a crack at VBA which is easily up to the task, I wan't to see effort first though as I won't code for free as a rule of thumb)

Replace Last 2 Digits

I would like to create a way to search through column "B" and replace the last two digits of values listed.
For example,
I'd like to have,
502040155 replaced to 5020400,
403041055 to 4030400,
603054055 to 6040500,
etc.
I'm assuming a LEFT or RIGHT formula is needed? VBA or formula works fine.a
I'm going to assume that your last example was a typo. Try,
=FLOOR(A2/100, 100)

How to split using the last backslash character as delimiter in excel 2013?

We have a list with 1000's of values in a single column.The values will be in this format
W:\RT_QAQC\Received\20160411_GDM_QA\VD\RegRef\Afr\Geology\IAE_Geology_Africa_10M
W:\RT_QAQC\Received\20160411_GDM_QA\VD\GlobRef\Ind\GIS\SS_GIS_Ind
I would like to split it using the last backslash a delemiter. So the result will be
W:\RT_QAQC\Received\20160411_GDM_QA\VD\RegRef\Afr\Geology
W:\RT_QAQC\Received\20160411_GDM_QA\VD\GlobRef\Ind\GIS
And in the next column,
IAE_Geology_Africa_10M
SS_GIS_Ind
I've tried with this one
=TRIM(RIGHT(SUBSTITUTE(A1,"\",REPT(" ",LEN(A1))),LEN(A1)))
But it's only copying the characters after the last backslash
How about:
=MID(A1,1,FIND(CHAR(1),SUBSTITUTE(A1,"\",CHAR(1),LEN(A1)-LEN(SUBSTITUTE(A1,"\",""))))-1)
This uses a simple technique to determine the position of the last occurrence of a substring in a string.
Another approach is to use tigeravatar's approach
Assuming your source data is in column A and you do not have a header row and your data start in row 1. In C1 use the formula you posted as it seems to do what you want for the second column. It also makes our life easIer on how to deal with the first column. In B1 place the following.
=LEFT(A1,LEN(A1)-LEN(C1)-1)
Results

Excel: Delete ALL to the right of the right of particular first "character"

I need to delete all text to the right of the first "|" in a group of cells.
I had been using this:
=IFERROR(RIGHT(input,LEN(input)-FIND("stack",input)+1),"")
to delete to the left of a specific character. I found this in a stackoverflow question.
I am not sure how to make it so it reads to find the FIRST specific character. I also am trying to delete to the right of, but I believe I can fix that myself.
Thanks in advance
Assuming by the first "|" in a group of cells you mean the leftmost pipe character in each cell of an array of cells then as #Aprillion suggests =LEFT(A1,FIND("|",A1)-1) seems a good approach (where A1 is the first element of the array and the formula is copied across/down as appropriate).
If the group is a column, an alternative could be to use Data > Data Tools – Text to Columns with Delimited and Other: |, then delete inserted columns as required.

Resources