List of file paths in excel. Want to extract the filename from paths, so everything after the LAST “” in...
Can a space-faring robot still function over a billion years?
I can't die. Who am I?
How does signal strength relate to bandwidth?
Why is it "take a leak?"
How does insurance birth control work?
Inconsistent behaviour between dict.values() and dict.keys() equality in Python 3.x and Python 2.7
Reason why dimensional travelling would be restricted
The need of reserving one's ability in job interviews
Is there a way to find out the age of climbing ropes?
Every subset equal to original set?
Lock enemy's y-axis when using Vector3.MoveTowards to follow the player
Is there a limit on the maximum number of future jobs queued in an org?
Being asked to review a paper in conference one has submitted to
Caulking a corner instead of taping with joint compound?
How to mitigate "bandwagon attacking" from players?
Make me a metasequence
Why are special aircraft used for the carriers in the United States Navy?
A bug in Excel? Conditional formatting for marking duplicates also highlights unique value
How to use math.log10 function on whole pandas dataframe
How to fix my table, centering of columns
Why is my Contribution Detail Report (native CiviCRM Core report) not accurate?
3.5% Interest Student Loan or use all of my savings on Tuition?
School performs periodic password audits. Is my password compromised?
Is every open circuit a capacitor?
List of file paths in excel. Want to extract the filename from paths, so everything after the LAST “” in the file path
how do i get a simple IF function to work in Excel only when another cell has a value in it?Extracting Characters from Folder Path in ExcelXNPV Excel function on Mac : not working?Can you apply names in OpenOffice Calc the same way you can in Excel?Excel INDIRECT function referencing cell with variable row from another worksheetExcel2013 - Grabbing data from specific cells based on the selection from a drop down listHow to sum up numbers without the sum functionSelect the last entry by date and type in ExcelIn Excel, Choosing a Word from a ListExcel: Getting the top five values from a row into a comma separated list
I've been trying to use a combination of Excel's =RIGHT function with FIND. I guess my thinking is:
Example:
I have "H:NIckPicturesFamdownload.jpg" in cell A1
I would like to then write a formula that would take the end "download.jpg" and drop it into A2.
My thinking so far:
- Start looking from the end of the cell text.
- When excel runs into the first instance of "" , extract everything up until that point into cell A2.
Am I going about this the right way?
microsoft-excel worksheet-function
New contributor
Nicolas Bernal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
I've been trying to use a combination of Excel's =RIGHT function with FIND. I guess my thinking is:
Example:
I have "H:NIckPicturesFamdownload.jpg" in cell A1
I would like to then write a formula that would take the end "download.jpg" and drop it into A2.
My thinking so far:
- Start looking from the end of the cell text.
- When excel runs into the first instance of "" , extract everything up until that point into cell A2.
Am I going about this the right way?
microsoft-excel worksheet-function
New contributor
Nicolas Bernal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
I've been trying to use a combination of Excel's =RIGHT function with FIND. I guess my thinking is:
Example:
I have "H:NIckPicturesFamdownload.jpg" in cell A1
I would like to then write a formula that would take the end "download.jpg" and drop it into A2.
My thinking so far:
- Start looking from the end of the cell text.
- When excel runs into the first instance of "" , extract everything up until that point into cell A2.
Am I going about this the right way?
microsoft-excel worksheet-function
New contributor
Nicolas Bernal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
I've been trying to use a combination of Excel's =RIGHT function with FIND. I guess my thinking is:
Example:
I have "H:NIckPicturesFamdownload.jpg" in cell A1
I would like to then write a formula that would take the end "download.jpg" and drop it into A2.
My thinking so far:
- Start looking from the end of the cell text.
- When excel runs into the first instance of "" , extract everything up until that point into cell A2.
Am I going about this the right way?
microsoft-excel worksheet-function
microsoft-excel worksheet-function
New contributor
Nicolas Bernal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Nicolas Bernal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Nicolas Bernal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked yesterday
Nicolas BernalNicolas Bernal
31
31
New contributor
Nicolas Bernal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Nicolas Bernal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Nicolas Bernal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Check out this page that does it for URLS.
It gives a good breakdown and explains the different parts of the formula.
Just change the character you need to look for to be the back-slash, and it will work for filenames.
=RIGHT(A1,LEN(A1)-FIND("@",SUBSTITUTE(A1,"","@",LEN(A1)-LEN(SUBSTITUTE(A1,"",""))),1))
Hi, this definitely solves my problem. I'm going to dig into it to understand it more. Thank you for pointing me in the right direction.
– Nicolas Bernal
yesterday
@BlueGI, probably best to add content to your answer rather than link to external content. Link-only (or almost link-only, like yours) answers are likely to be downvoted and possibly flagged.
– Alex M
yesterday
add a comment |
As long as you're not using an ancient version of Office, InstrRev makes it simpler to find the last in the file name. It parses the string right to left instead of left to right (as Instr does).
Try this:
Sub TestExtract()
Debug.Print ExtractFilename("H:NickPicturesFamdownload.jpg")
Debug.Print ExtractFilename("H:Famdownload.jpg")
Debug.Print ExtractFilename("H:download.jpg")
Debug.Print ExtractFilename("H:download.jpg")
End Sub
Function ExtractFilename(sFullPath As String) As String
Dim x As Long
If InStr(sFullPath, "") > 0 Then
x = InStrRev(sFullPath, "")
ExtractFilename = Mid$(sFullPath, x + 1)
Else
' Might be a fullpath like C:somefile.xxx
If InStr(sFullPath, ":") > 0 Then
x = InStr(sFullPath, ":")
ExtractFilename = Mid$(sFullPath, x + 1)
End If
' Other oddities? Handle 'em here
End If
End Function
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Nicolas Bernal is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1411502%2flist-of-file-paths-in-excel-want-to-extract-the-filename-from-paths-so-everyth%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Check out this page that does it for URLS.
It gives a good breakdown and explains the different parts of the formula.
Just change the character you need to look for to be the back-slash, and it will work for filenames.
=RIGHT(A1,LEN(A1)-FIND("@",SUBSTITUTE(A1,"","@",LEN(A1)-LEN(SUBSTITUTE(A1,"",""))),1))
Hi, this definitely solves my problem. I'm going to dig into it to understand it more. Thank you for pointing me in the right direction.
– Nicolas Bernal
yesterday
@BlueGI, probably best to add content to your answer rather than link to external content. Link-only (or almost link-only, like yours) answers are likely to be downvoted and possibly flagged.
– Alex M
yesterday
add a comment |
Check out this page that does it for URLS.
It gives a good breakdown and explains the different parts of the formula.
Just change the character you need to look for to be the back-slash, and it will work for filenames.
=RIGHT(A1,LEN(A1)-FIND("@",SUBSTITUTE(A1,"","@",LEN(A1)-LEN(SUBSTITUTE(A1,"",""))),1))
Hi, this definitely solves my problem. I'm going to dig into it to understand it more. Thank you for pointing me in the right direction.
– Nicolas Bernal
yesterday
@BlueGI, probably best to add content to your answer rather than link to external content. Link-only (or almost link-only, like yours) answers are likely to be downvoted and possibly flagged.
– Alex M
yesterday
add a comment |
Check out this page that does it for URLS.
It gives a good breakdown and explains the different parts of the formula.
Just change the character you need to look for to be the back-slash, and it will work for filenames.
=RIGHT(A1,LEN(A1)-FIND("@",SUBSTITUTE(A1,"","@",LEN(A1)-LEN(SUBSTITUTE(A1,"",""))),1))
Check out this page that does it for URLS.
It gives a good breakdown and explains the different parts of the formula.
Just change the character you need to look for to be the back-slash, and it will work for filenames.
=RIGHT(A1,LEN(A1)-FIND("@",SUBSTITUTE(A1,"","@",LEN(A1)-LEN(SUBSTITUTE(A1,"",""))),1))
edited yesterday
answered yesterday
BlueGIBlueGI
2063
2063
Hi, this definitely solves my problem. I'm going to dig into it to understand it more. Thank you for pointing me in the right direction.
– Nicolas Bernal
yesterday
@BlueGI, probably best to add content to your answer rather than link to external content. Link-only (or almost link-only, like yours) answers are likely to be downvoted and possibly flagged.
– Alex M
yesterday
add a comment |
Hi, this definitely solves my problem. I'm going to dig into it to understand it more. Thank you for pointing me in the right direction.
– Nicolas Bernal
yesterday
@BlueGI, probably best to add content to your answer rather than link to external content. Link-only (or almost link-only, like yours) answers are likely to be downvoted and possibly flagged.
– Alex M
yesterday
Hi, this definitely solves my problem. I'm going to dig into it to understand it more. Thank you for pointing me in the right direction.
– Nicolas Bernal
yesterday
Hi, this definitely solves my problem. I'm going to dig into it to understand it more. Thank you for pointing me in the right direction.
– Nicolas Bernal
yesterday
@BlueGI, probably best to add content to your answer rather than link to external content. Link-only (or almost link-only, like yours) answers are likely to be downvoted and possibly flagged.
– Alex M
yesterday
@BlueGI, probably best to add content to your answer rather than link to external content. Link-only (or almost link-only, like yours) answers are likely to be downvoted and possibly flagged.
– Alex M
yesterday
add a comment |
As long as you're not using an ancient version of Office, InstrRev makes it simpler to find the last in the file name. It parses the string right to left instead of left to right (as Instr does).
Try this:
Sub TestExtract()
Debug.Print ExtractFilename("H:NickPicturesFamdownload.jpg")
Debug.Print ExtractFilename("H:Famdownload.jpg")
Debug.Print ExtractFilename("H:download.jpg")
Debug.Print ExtractFilename("H:download.jpg")
End Sub
Function ExtractFilename(sFullPath As String) As String
Dim x As Long
If InStr(sFullPath, "") > 0 Then
x = InStrRev(sFullPath, "")
ExtractFilename = Mid$(sFullPath, x + 1)
Else
' Might be a fullpath like C:somefile.xxx
If InStr(sFullPath, ":") > 0 Then
x = InStr(sFullPath, ":")
ExtractFilename = Mid$(sFullPath, x + 1)
End If
' Other oddities? Handle 'em here
End If
End Function
add a comment |
As long as you're not using an ancient version of Office, InstrRev makes it simpler to find the last in the file name. It parses the string right to left instead of left to right (as Instr does).
Try this:
Sub TestExtract()
Debug.Print ExtractFilename("H:NickPicturesFamdownload.jpg")
Debug.Print ExtractFilename("H:Famdownload.jpg")
Debug.Print ExtractFilename("H:download.jpg")
Debug.Print ExtractFilename("H:download.jpg")
End Sub
Function ExtractFilename(sFullPath As String) As String
Dim x As Long
If InStr(sFullPath, "") > 0 Then
x = InStrRev(sFullPath, "")
ExtractFilename = Mid$(sFullPath, x + 1)
Else
' Might be a fullpath like C:somefile.xxx
If InStr(sFullPath, ":") > 0 Then
x = InStr(sFullPath, ":")
ExtractFilename = Mid$(sFullPath, x + 1)
End If
' Other oddities? Handle 'em here
End If
End Function
add a comment |
As long as you're not using an ancient version of Office, InstrRev makes it simpler to find the last in the file name. It parses the string right to left instead of left to right (as Instr does).
Try this:
Sub TestExtract()
Debug.Print ExtractFilename("H:NickPicturesFamdownload.jpg")
Debug.Print ExtractFilename("H:Famdownload.jpg")
Debug.Print ExtractFilename("H:download.jpg")
Debug.Print ExtractFilename("H:download.jpg")
End Sub
Function ExtractFilename(sFullPath As String) As String
Dim x As Long
If InStr(sFullPath, "") > 0 Then
x = InStrRev(sFullPath, "")
ExtractFilename = Mid$(sFullPath, x + 1)
Else
' Might be a fullpath like C:somefile.xxx
If InStr(sFullPath, ":") > 0 Then
x = InStr(sFullPath, ":")
ExtractFilename = Mid$(sFullPath, x + 1)
End If
' Other oddities? Handle 'em here
End If
End Function
As long as you're not using an ancient version of Office, InstrRev makes it simpler to find the last in the file name. It parses the string right to left instead of left to right (as Instr does).
Try this:
Sub TestExtract()
Debug.Print ExtractFilename("H:NickPicturesFamdownload.jpg")
Debug.Print ExtractFilename("H:Famdownload.jpg")
Debug.Print ExtractFilename("H:download.jpg")
Debug.Print ExtractFilename("H:download.jpg")
End Sub
Function ExtractFilename(sFullPath As String) As String
Dim x As Long
If InStr(sFullPath, "") > 0 Then
x = InStrRev(sFullPath, "")
ExtractFilename = Mid$(sFullPath, x + 1)
Else
' Might be a fullpath like C:somefile.xxx
If InStr(sFullPath, ":") > 0 Then
x = InStr(sFullPath, ":")
ExtractFilename = Mid$(sFullPath, x + 1)
End If
' Other oddities? Handle 'em here
End If
End Function
answered yesterday
Steve RindsbergSteve Rindsberg
3,6101913
3,6101913
add a comment |
add a comment |
Nicolas Bernal is a new contributor. Be nice, and check out our Code of Conduct.
Nicolas Bernal is a new contributor. Be nice, and check out our Code of Conduct.
Nicolas Bernal is a new contributor. Be nice, and check out our Code of Conduct.
Nicolas Bernal is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1411502%2flist-of-file-paths-in-excel-want-to-extract-the-filename-from-paths-so-everyth%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown