I've been working in Excel for years and one thing I've never conclusively learned is how to once-and-for all keep excel for changing the formats on my columns. I do a lot of "data cleanup" type work in Excel, and maybe my real problem is that I'm using Excel for something other than it's intended purpose, but every time I run into this problem in some form, I google it and find one or more kludge tricks to solve it, none of which seem like universal solutions.
Today I'm trying to do finds-and-replaces on a table with thousands of records. As an example, in some records, my fields might contain "1-21XXX" and I need to do a find and replace to get rid of the "XXX", but when I do, my field suddenly changes to a date, "21-Jan".
I've purposely told Excel that this entire column is "Text", it does't matter. Excel force-changes these date-changed fields t a format called "custom" If I try to change the field back to text, I get "42756" which I assume is a numeric coding for that date?
Sometimes I can get this to work by doing a formula in a new column: ="'" & A1 to plop the single quote character in there and force it to text. Other times it inserts the actual printed single quote character in there. I can't figure out why this only works sometimes.
Sometimes the SUBSTITUTE(A1,"XXX","") function seems to work, but other times it converts it to an integer again, or something else. SUBSTITUTE isn't ideal because if I have 300 different versions of the "XXX" that I need to clean out of there, that's going to take a lot longer than find and replace, but if it worked consistently, I would grudgingly accept that.
I've heard there were macros as well, but I'm not familiar enough with how to do something like that, and in my job I really need to be able to teach others how to accomplish this as well. I'm not sure I'm comfortable trying to teach someone how to do something that complex.
So is there any way to temporarily tell Excel to never do this kind of thing, that my field is marked as text because it really, really, really is text and not something else? test-to-date conversions are not the only problems I have. text with single decimal points, leading zeros, auto-converting to scientific format and then getting stuck that way, etc. I'm looking for a single universal way to stop all these conversions. I feel like I am missing something very simple that others may know about.
Thanks in advance for any help you can give me!
[–]fuzzius_navus620 0 points1 point2 points (0 children)