Convert #NAME? values to Strings

gelen4o

New Member
Joined
Jul 31, 2017
Messages
28
Hi,

I have row data that contains serial numbers in the following format "-VPT0000017J". Due to the minus upfront excel thinks this is a formula and assigns an additional "=" to the front. All and all I get an end result of "=-VPT0000017J", which is then displayed as #NAME? making it impossible to format.

Changing the way source data is formatted is not an option so I need a way to get rid of the additional characters.
I already tried using RIGHT; RIGHT+LEN(-2),SUBSITUTE or CTRL + F (Replace). Neither of them worked for me.

I would like a solution that I can turn into a simple VBA, which is to go through the entire column and automatically replace "=-" if needs be.

Any help will be much appreciated!
 
Last edited:

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
What happens if you remove the "-"? Select the column and use Replace function, does the data then look ok?
 
Last edited:
Upvote 0
Hello! Easy solution for you:

1. Highlight the column that these errors are in
2. Press control + F (Find and Replace)
3. Click the Replace Tab
4. In the "Find What:" box type: =
5. In the "Replace with:" box type: '
6. Hit Replace All

Let me know if this works or if you need any more help!
 
Upvote 0
Thank you all for the suggestions !!!
Eventually it took a bit of everything to resolve the issue

What worked for me is as follows:

1. First convert the entire column as text (either source file or destination sheet)
2. Then use CRTL + H to replace "=-" with whatever value or simply leave blank.
It's crucial for the "-" to be removed as this is what has caused the problem in the first place

After that values will appear as text !
VBA and Pivot Tables have no problem working with them
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,182
Members
452,615
Latest member
bogeys2birdies

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top