Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a column containing file paths. I want to make another column which contain the extensions of the paths only. How can I do this in Microsoft Excel?

share|improve this question
1  
For anyone that's looking how to to this in Google Spreadsheet, you can use REGEXEXTRACT(A1, "\.([^.]*)$") –  Joe Aug 9 at 9:21

3 Answers 3

up vote 13 down vote accepted
=REPLACE(RIGHT(A1,5),1,SEARCH(".",RIGHT(A1,5)),"")

This formula wil be useful if you have more than one dot in filename

share|improve this answer
    
Thanks Cyril. Your math is brilliant! –  Nam G VU May 17 '10 at 9:04
1  
Note that this only works for file extensions that are four characters or shorter. –  Tim Robinson Mar 21 '13 at 16:26
    
You can just change the 5 to a 6 or whatever, right? –  Scott Beeson Mar 11 at 14:45
    
Nope, that causes issues. –  Scott Beeson Mar 11 at 15:11

Taken from another answer (changed to look for dots and not spaces):

=RIGHT(A1,LEN(A1)-FIND("|",SUBSTITUTE(A1,".","|",LEN(A1)-LEN(SUBSTITUTE(A1,".","")))))
share|improve this answer
    
works a treat! Thanks for the quick copy/paste solution. Works for file extensions with 2 to 7 character file extensions with full paths and namespaces notation in filename. –  Zephan Schroeder Jul 21 at 6:01

Assuming you have nicely formatted extensions, you can do this quickly as =RIGHT(A1,3). A more robust solution would find the index of the rightmost . and then extract the remaining characters.

share|improve this answer
    
Reading your question that is the answer I would have given. –  VerGuy May 17 '10 at 6:59
    
I think the real question here is: how to find the rightmost "." in Excel. –  petersohn May 17 '10 at 7:06
    
The extension is not alsway in 3 characters. @pertersohn: Yeah, you're right. –  Nam G VU May 17 '10 at 8:58

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.