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

3 Answers 3

up vote 11 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

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

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

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.