Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Denise H. via OfficeKB.com
 
Posts: n/a
Default Using Replace to Format Negative Numbers

We receive data from an outside source and have no control over its
appearance. On their worksheet negative numbers show up like this $4.33- or
8-. I can use a wildcard character in the search field to find these
occurences but have found that I can't change the format to the proper one, -
$4.33 or -8. In the search field I enter *- but if I enter -* in the replace
field, Excel replaces my number with -*. Suggestions?


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...excel/200508/1
  #2   Report Post  
Dave O
 
Posts: n/a
Default

One of the gurus will likely respond with a brilliant built-in Excel
function that does this automatically. Until they do, this work-around
will work. Assuming all your data is in column A, add a column, enter
this formula, and copy down to address the entire column of data:
=IF(RIGHT(TRIM(A1),1)="-",MID(TRIM(A1),1,LEN(TRIM(A1))-1)*-1,A1)

This formula checks each entry for the trailing negative sign, and
converts it from a string to a negative number; if the entry is
non-negative and numeric the formula returns the number. You can then
copy this column, paste it as values over your original data, and
delete the inserted column.

  #3   Report Post  
JE McGimpsey
 
Posts: n/a
Default

take a look he


http://www.mcgimpsey.com/excel/postfixnegatives.html


In article ,
"Denise H. via OfficeKB.com" wrote:

We receive data from an outside source and have no control over its
appearance. On their worksheet negative numbers show up like this $4.33- or
8-. I can use a wildcard character in the search field to find these
occurences but have found that I can't change the format to the proper one, -
$4.33 or -8. In the search field I enter *- but if I enter -* in the replace
field, Excel replaces my number with -*. Suggestions?

  #4   Report Post  
Denise H. via OfficeKB.com
 
Posts: n/a
Default

Thank you. My colleague has been struggling with this for years, tediously
fixing each instance. I was sure one of you smart people could help.

JE McGimpsey wrote:
take a look he

http://www.mcgimpsey.com/excel/postfixnegatives.html

We receive data from an outside source and have no control over its
appearance. On their worksheet negative numbers show up like this $4.33- or
8-. I can use a wildcard character in the search field to find these
occurences but have found that I can't change the format to the proper one, -
$4.33 or -8. In the search field I enter *- but if I enter -* in the replace
field, Excel replaces my number with -*. Suggestions?



--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...excel/200508/1
  #5   Report Post  
Denise H. via OfficeKB.com
 
Posts: n/a
Default

Thank you. Appreciate your formula. I also got a posting with this website,
http://www.mcgimpsey.com/excel/postfixnegatives.html. There is an Excel
feature called Text to Columns under the Data menu which easily accomplishes
this.


Dave O wrote:
One of the gurus will likely respond with a brilliant built-in Excel
function that does this automatically. Until they do, this work-around
will work. Assuming all your data is in column A, add a column, enter
this formula, and copy down to address the entire column of data:
=IF(RIGHT(TRIM(A1),1)="-",MID(TRIM(A1),1,LEN(TRIM(A1))-1)*-1,A1)

This formula checks each entry for the trailing negative sign, and
converts it from a string to a negative number; if the entry is
non-negative and numeric the formula returns the number. You can then
copy this column, paste it as values over your original data, and
delete the inserted column.



--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...excel/200508/1
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
csv converting numbers to scientific format JR Excel Discussion (Misc queries) 7 June 16th 05 12:13 AM
Negative Numbers in Brackets - HELP! Hélène Excel Discussion (Misc queries) 21 February 18th 05 10:08 PM
How do I format a cell so that only specific numbers can be enter. Jim Excel Discussion (Misc queries) 1 February 1st 05 04:51 PM
How do I replace a negative number at the end of a formula with a. dealn2 Excel Discussion (Misc queries) 5 December 23rd 04 07:47 PM
How to Replace numbers and text with numbers only? Robert Judge Excel Worksheet Functions 3 November 5th 04 04:36 PM


All times are GMT +1. The time now is 08:07 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"