#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 13
Default Formating a cell

Hi! I am working on a spreadsheet where I have 5 columns of time. I need to
reformat all 5 columns to be the same. My time reads for example, 11:55 -
12:45. I want to reformat the cell so that there is a space before and after
the hyphen. Is there a formula to help me with this? I really don't want to
have to go to each cell and add those spaces.

Please help!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,722
Default Formating a cell

You can do this quickly with 3 Find&Replace operations. Do not include
quotation marks in actual find/replace.

Find:
" -"
Replace:
""

Find:
"- "
Replace:
""

Find:
"-"
Replace:
" - "
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Smiley" wrote:

Hi! I am working on a spreadsheet where I have 5 columns of time. I need to
reformat all 5 columns to be the same. My time reads for example, 11:55 -
12:45. I want to reformat the cell so that there is a space before and after
the hyphen. Is there a formula to help me with this? I really don't want to
have to go to each cell and add those spaces.

Please help!

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,276
Default Formating a cell

Hi,
Hit CTRL H, find what type -
replace with :space - space
Replace

"Smiley" wrote:

Hi! I am working on a spreadsheet where I have 5 columns of time. I need to
reformat all 5 columns to be the same. My time reads for example, 11:55 -
12:45. I want to reformat the cell so that there is a space before and after
the hyphen. Is there a formula to help me with this? I really don't want to
have to go to each cell and add those spaces.

Please help!

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,934
Default Formating a cell

If you want to do it with a formula (as you requested), try this one...

=SUBSTITUTE(SUBSTITUTE(A1," ",""),"-"," - ")

If you want to do it with Excel's function, I would suggest first replacing
the space character with nothing and then replacing the dash with space
dash space.

--
Rick (MVP - Excel)


"Smiley" wrote in message
...
Hi! I am working on a spreadsheet where I have 5 columns of time. I need
to
reformat all 5 columns to be the same. My time reads for example, 11:55 -
12:45. I want to reformat the cell so that there is a space before and
after
the hyphen. Is there a formula to help me with this? I really don't want
to
have to go to each cell and add those spaces.

Please help!


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 13
Default Formating a cell

Hi Luke - Am I doing something wrong? I am leaving the replace portion blank
& the spreadsheet is not changing. Also, I realized that I have hypens in
other areas of my spreadsheet - oops! Is this still doable?

"Luke M" wrote:

You can do this quickly with 3 Find&Replace operations. Do not include
quotation marks in actual find/replace.

Find:
" -"
Replace:
""

Find:
"- "
Replace:
""

Find:
"-"
Replace:
" - "
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Smiley" wrote:

Hi! I am working on a spreadsheet where I have 5 columns of time. I need to
reformat all 5 columns to be the same. My time reads for example, 11:55 -
12:45. I want to reformat the cell so that there is a space before and after
the hyphen. Is there a formula to help me with this? I really don't want to
have to go to each cell and add those spaces.

Please help!



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,934
Default Formating a cell

You need to select your cells first, then call up the Edit/Replace dialog.
You can do the procedure in one less step using the method I outlined in my
first posting to this thread (it will also handle cases where there are lots
of extra spaces around the dash as well).

--
Rick (MVP - Excel)


"Smiley" wrote in message
...
Hi Luke - Am I doing something wrong? I am leaving the replace portion
blank
& the spreadsheet is not changing. Also, I realized that I have hypens in
other areas of my spreadsheet - oops! Is this still doable?

"Luke M" wrote:

You can do this quickly with 3 Find&Replace operations. Do not include
quotation marks in actual find/replace.

Find:
" -"
Replace:
""

Find:
"- "
Replace:
""

Find:
"-"
Replace:
" - "
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Smiley" wrote:

Hi! I am working on a spreadsheet where I have 5 columns of time. I
need to
reformat all 5 columns to be the same. My time reads for example,
11:55 -
12:45. I want to reformat the cell so that there is a space before and
after
the hyphen. Is there a formula to help me with this? I really don't
want to
have to go to each cell and add those spaces.

Please help!


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
Need help with formating cell Bandit Excel Discussion (Misc queries) 4 August 12th 11 06:16 PM
Cell Formating Curt Hand Excel Worksheet Functions 3 October 20th 06 04:17 PM
Cell to follow content AND/OR formating of another cell 0-0 Wai Wai ^-^ Excel Discussion (Misc queries) 1 September 8th 05 02:00 PM
cell formating Pat DeStasio Excel Worksheet Functions 2 April 9th 05 10:23 PM
Cell not formating Mojoala Excel Discussion (Misc queries) 2 January 17th 05 08:21 PM


All times are GMT +1. The time now is 12:51 AM.

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

About Us

"It's about Microsoft Excel"