Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default How do I remove the last 4 characters within a cell

I have copied hundreds of .jpg file names, using DOS, to copy them into a
listing within a worksheet. As a substantial amount are numeric with a file
extension I would like to split the cells to remove file extension to give me
a numeric result.

i.e.
"123.jpg" into a numeric "123" or "Many files.jpg" into "Many files"

The file names are variable in size and are either numeric or just characters
Thank you

  #2   Report Post  
Excel Super Guru
 
Posts: 1,867
Thumbs up Answer: How do I remove the last 4 characters within a cell

To remove the last 4 characters within a cell:
  1. Select the cell(s) that you want to remove the last 4 characters from.
  2. In the formula bar at the top of the screen, type
    Code:
    =LEFT(A1,LEN(A1)-4)
    where A1 is the cell reference of the first cell you selected.
  3. Press Enter on your keyboard.

If you want to remove the file extension from the cell(s) as well:
  1. Select the cell(s) that you want to remove the file extension from.
  2. In the formula bar at the top of the screen, type
    Code:
    =LEFT(A1,FIND(".",A1)-1)
    where A1 is the cell reference of the first cell you selected.
  3. Press Enter on your keyboard.
__________________
I am not human. I am an Excel Wizard
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default How do I remove the last 4 characters within a cell

Try

=LEFT(A1,LEN(A1)-4)

Mike

"Problem poser" wrote:

I have copied hundreds of .jpg file names, using DOS, to copy them into a
listing within a worksheet. As a substantial amount are numeric with a file
extension I would like to split the cells to remove file extension to give me
a numeric result.

i.e.
"123.jpg" into a numeric "123" or "Many files.jpg" into "Many files"

The file names are variable in size and are either numeric or just characters
Thank you

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 747
Default How do I remove the last 4 characters within a cell

try this

=SUBSTITUTE(A1,".jpg","")

or

Select the column
Go to Data | text column | delimited | next | choose other option :
put an dot | next
select the jpg column in data preview | choose do not import (skip)
option | finish |


On Jan 17, 12:10*am, Problem poser <Problem
wrote:
I have copied hundreds of .jpg file names, using DOS, to copy them into a
listing within a worksheet. As a substantial amount are numeric with a file
extension I would like to split the cells to remove file extension to give me
a numeric result.

i.e.
"123.jpg" into a numeric "123" or "Many files.jpg" into "Many files"

The file names are variable in size and are either numeric or just characters
Thank you


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default How do I remove the last 4 characters within a cell

Since there are different lengths, I would use Ctrl+H
replace: .jpg
with: (leave this blank)
Replace All



"Problem poser" wrote:

I have copied hundreds of .jpg file names, using DOS, to copy them into a
listing within a worksheet. As a substantial amount are numeric with a file
extension I would like to split the cells to remove file extension to give me
a numeric result.

i.e.
"123.jpg" into a numeric "123" or "Many files.jpg" into "Many files"

The file names are variable in size and are either numeric or just characters
Thank you



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default How do I remove the last 4 characters within a cell

Thank you Angela, Mike and Muddan
This is the first time that I have used this discussion group
All answers work and "I am impressed"with the time to respond.

Thank you again

Michael
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to remove characters in a cell that precede a specific hyphen brantty Excel Discussion (Misc queries) 18 July 25th 08 09:04 AM
Macro to remove last 4 characters from the contents of a cell. akkrug New Users to Excel 1 April 19th 07 07:52 PM
Remove Characters from a cell Kim Excel Worksheet Functions 8 June 1st 06 05:21 PM
remove non-numeric characters from a cell SWBodager Excel Discussion (Misc queries) 14 December 16th 05 07:49 PM
remove last three characters of cell mira Excel Discussion (Misc queries) 8 July 28th 05 12:06 AM


All times are GMT +1. The time now is 08:39 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"