Paste plain text into excel, blank column was missing? - excel

for example, the plain text is:
a{tab}{tab}c
note here have 2 tabs between a and c, paste it into excel, normal result is 3 cells: 1=a, 2=empty, 3=c.
but one pc is different, it just get 2 cells: 1=a, 2=c.
excel 2010 x64, please help.

Import text and Text to Columns have very similar interfaces and both 'remember' previous settings.
One of the settings is 'Treat consecutive delimiters as one'. It seems your rogue PC has this setting 'remembered' while the others do not.

Related

Using a split formula in Excel with inconsistent data, as we do in Google sheets

We want to migrate some spreadsheets from Google sheets to Excel. We figured out how to manage all the needed formulas, except one: SPLIT.
Here is a public view link to a sample file, which shows you how we currently do this in Google sheets:
https://docs.google.com/spreadsheets/d/1D1ceuF28CqMtr0tEPdAQNLSvvuFMFAQE54fopS2wvAo/edit?usp=sharing
Column B contains, for each record, a list of the record's favorite charitable causes, such as Animal welfare, Cancer, Digital divide, Environment, Human Rights, Hunger, Medical research, etc. A cell in that column might contain no content, one cause, or as many as 16 causes, each on a separate line within that cell. The Google delimiter for those line breaks within a cell is "char(10)." (I do not know if Excel uses the same for a line break).
In Google sheets, our formula in column C is
=if(len(B2)=0,"",split(B2,char(10))). The first part just makes sure that we do not get a #VALUE error if the cell is empty.
We are familiar with the 'Text to Columns' menu options, but we need a formula in column C such that everything gets updated automatically whenever the content of column B is changed; we cannot do it manually each time.
Please note that the number of entries in column B is inconsistent, as is the length of each element.
How can we do this?
Excel
=TRIM(MID(SUBSTITUTE($B2,UNICHAR(10),REPT(" ",LEN($B2))),(C$1-1)*LEN($B2)+1,LEN($B2)))
B2 is the cell with your array.
UNICHAR(10) is newline.
C1 is the index.
The formula splits up the array by newline character, just like in your google sheet which uses CHAR(10). Then, it uses C1, to identify which item in the array.
In Office 365 =TEXTSPLIT(B2,CHAR(10))

how to spill cells in excel if I have two spaces between text

I want to split cells in excel. I have one column A with many rows and between the text there are 2 spaces, For example  
    
2 GABRIE 205.10  V3361  40.00 
3 THOMAS 230.80  A1003  20.00 
.
.
must be split into 5 columns.
UPDATE
After using =CODE(A2) to test on the file you provided, those so called "spaces" are actually char(160). Basically they are Non-breaking spaces that is common character entities in HTML used to make two words stick together at the end of a line. If you are pasting a string into Excel from an HTML-based source, it is possible you will run into this issue.
Solution
Apply this formula =SUBSTITUTE(A2,CHAR(160)," ") to your cells and modify accordingly. You will get the "same data" but different result. See image for reference.
After applying the formula, copy the result to a text editor(Notepad) or whatever you comfortable with. The copy back the result in Notepad to excel, it will auto split into 5 columns. (Actually 6 if the space is considered).

Excel convert to h.mm format automatically

Is it possible to let Excel 2010 not automatically convert a text or number cell into h.mm format?
In other words I've 10 thousand cells that contain numbers and parenthesis like these ones:
1.2 (905.A)
1.3 (905.A1B)
etc. etc.
If I do find (*) and replace to nothing, Excel automatically convert these cells to h.mm format, also if I set these cells as "Text", so it display:
1.02
1.03
etc. etc.
instead I want:
1.2
1.3
etc. etc.
is there a way to do it?
Have you tried changing the column formats to text before pasting the values in?
If you are entering the values manually rather than pasting then prefixing the entry with a single quote will make Excel treat the field as literal text:
'1.2 (905.A)
UPDATE
After discussion I now understand that the problem occurs after the data in imported when you try to do a find and replace to get rid of the brackets and anything within them. I cannot replicate this issue, Excel seems to format the remaining number appropriately for me, but as you are still having this issue I would suggest an alternative approach to the find and replace:
If the text you quoted was in cell A1 then in B1 you could use:
=LEFT(A1,FIND(" ",A1)-1)
This will return everything before the space. You can then either just hide the column you don't need or copy the new values, right click and do paste special then select values to replace the formulas with their values and therefore remove the need for the old column.

Excel always change my data to date when copy a html sheet to it

I copy a sheet from html page.Because I need the sheet structure,the "paste as text" selection is no use here.
The data will be like this
2/3 3/4
1012/2332 332/665
when paste to excel
2/3/2012 3/4/2012
1012/2332 332/665
the data cannot be parsed to date form is safe while those which can will be changed and cannot be changed back in format cell.
How to disable this feature of excel,really annoying.
This is an obnoxious problem. Have you tried setting the cell format to Text before pasting as text? this works for me in 2003. I'm afraid simply doing one or the other is not enough, and the order is important.
If this works (and you need to do this frequently or regularly), you can set up a custom macro (e.g. CTRL-SHIFT-P, etc.) to set the format and do the paste all in one motion.
EDIT:
For the record, here is what the different paste methods produced for "2/3":
Paste (normal) 3-Feb
TXT Format->Paste 3-Feb
Paste->TXT Format 40942
Paste UNI 3-Feb
*TXT Format->Paste UNI 2/3
Paste UNI->TXT Format 40942
Paste TXT 3-Feb
*TXT Format->Paste TXT 2/3
Paste TXT->TXT Formar 40942
Up until recently (2/27/2013) the Excel data import of the bank account text file information handled the date field of the text file correctly. It isn't clear to me why this changed, but it lead to my looking here for a solution.
I'd like to propose to you a different solution than above...
copy the offending dates to a separate excel sheet
use the Mid function ( mid(string, start, number of chars) to extract each date component to
a separate column in the same row (Look at columns B, C, and D
in the next column use the Date function ( date(yr, month, day) to convert the date components
from the prior three columns into something excel will deign to recognize as a date (remember,
computers are basically stupid, and Microsoft programs are about the contrariest things on the
planet!)
PASTE SPECIAL the values from your date column back to your worksheet
VOILA! You have fixed a problem that you should NEVER have had in the first place.
I tried to paste the spreadsheet here (and also by hand typing, but this display collapses repeating characters. Suffice to say it looks like this...
02/27/2013 02 27 2013 02/27/2013
original mm dd yyyy value ms recognizes as a date which you can paste by value back to spreadsheet
the formulas for those not familiar with Excel...
un-date from worksheet in column at (excel sees as a string...not a number!)
for month: mid(a1,1,2) (take the thing in column a1, start at the 1st character, and grab two chars)
for day: mid(a1,4, 2) (take the same thing from column a1, grab the two chars starting at the 4th)
for year: mid(a1,7,4) ...
making it a date: you now have month in column b1, day in column c1, and year in column d1, so
in column e1 you say: date(d1, b1, c1), and then you see the same date as shown in column a1, however, this will now be recognized by Excel as a date! Copy this and PASTE SPECIAL>Value to the column in your original worksheet and it will respond.
I had looked in the original column for a ' character which denotes treat this value as text only, but I hadn't found one. I do not know why Excel has become pesky like this, but I have come to expect this type of frustrating and annoying behavior from Microsoft programs. Yes, I do still buy the darn things, but often choose open source code when I can because of these "features".
Good luck.
I just came across this problem and found a really good solution. Here are my steps:
Copy and paste so that you can work out the area to be selected.
Delete the contents of the cells
Change the formatting to TEXT
re-paste but use the paste button in the menu bar and choose 'Match Destination formatting'.
This works like a dream! :)

external data formatting strips off leading zero

I am using excel 2003 and importing an external data source from an asp page.
This page returns a table of data that populates the excel cells.
If a cell has a phone number in it, the leading zero is removed by excel, although if I look at the query in the import dialog, the zero is still there!
The cells have been formatted as "text" in the hope this would not happen, but still the text gets treated as a number!
Any ideas? I could really do with some help on this one.
Hmm, changing the NumberFormat to text should work. If you're dealing with a fixed-width cell (i.e., 10 digits for a phone number), you can manually prepend leading zeros. Assuming data is in column A, put this formula into column B
=right("000000000"&A1,10)
You can then copy and PasteSpecial into column A.
If the cells are not fixed width and If you have access to the query that populates the asp page, you can insert a temporary column that has the desired cell length and use that to modify the function.
Likewise, if you're just looking to display the information and you don't need to act on it, you can put a number mask over the cell (Format Cell->Custom->0000000000).
As for upgrading, I am currently using Excel 2007 and constantly import data with prepended zeros by making the specific column a Text field.

Resources