3
votes

I'm trying to copy paste numberic data from database to Excel. In the database the decimal separator is dot (.) and in my Excel the decimal separator is comma (,). Now when I copy paste this data from the database to excel, numberic data is converted to dates. How to prevent this and get data converted to numbers (with comma decimal separator)?

Data:

1.2
1.3
1.4

Converts to (in my locale)

1.helmi
1.maalis
1.huhti

Although is should be

1,2
1,3
1,4
5
Can you please show some data?Himanshu Jansari
I keep an instance of OpenOffice around if that problem pops up... I think there is a better solution, but this usually works.ppeterka
First raw) solution : change the separator for the current file before you copy-paste the data. For other solution, could you explain how you copy-paste the data from the db? (e.g. copy/paste in Windows from the UI of a db)JMax
The copy source does not matter. The same happens when I copy paste from notepad.jrara

5 Answers

1
votes

I use Notepad++ for this task: copy your data to notepad++ replace the "." with "," and copy it to excel.

0
votes

Yeah, this is a real pain sometimes - my quick solution is to use cells formatted as text.

Here is how it works:

  • copy your numbers with the .
  • select a column or some cells
  • change cell-format to text
  • now paste-special (or paste-contents) as unformatted/plain text
  • now replace . with ,
  • now change format back to number or default

You can put this in some macro of course.

However, I think there might - or at least should be - a better solution.

But as a quickie, this works too ;)

0
votes

First mark the cells that you're going to paste to. Right click, "Format" and then select "Number".

Now right click to paste, and select "Match Destination Formatting"

Your text will now be pasted as numbers again :)

0
votes
  1. Open Microsoft Word
  2. Paste your data from web
  3. Open excel
  4. Format all as text
  5. copy all from word (Ctr+A)
  6. Paste special in Excel as text vuala!