reforrer
reforrer

Reputation: 745

Some but not all Excel numbers show as a date

I have a big .xls file. Some numbers show as a date.
31.08 shows as 31.aug
31.13 shows as 31.13 (that is what i want all columns to be)
When I reformat 31.aug to number it shows as 40768,00 I have found no ways to convert 31.aug to 31.08 as a number. All I am able to do is to reformat 31.aug as d.mm and then it shows as 31.08 and when I try to reformat it from 31.08 to number it shows as 40768,00. No way to cheat Excel using different types of cell formats.

Upvotes: 2

Views: 17512

Answers (6)

Clara
Clara

Reputation: 1

All you have to do is format cell.

1-right click on the cell where you want to insert the number.

2-then click on Number and select 'General' from the number menu.

Hope this will help future people with the same issue.

Upvotes: 0

Andrew
Andrew

Reputation: 21

The data you are pasting, is it by any chance a pivot table.

For example, like you, I am copying a lot of data into a large spreadsheet. The data I am copying is from another sheet and it is a pivot table.

If I paste normally, half will show up as numbers, which they are in the source file and half will show up as dates, for no reason, which drives me insane.

If I Paste->Values however, they will all show up as numbers, and as I don't need the pivot functionality in the destination file this solution is fine.

Upvotes: 0

Angel
Angel

Reputation: 1

As suggested above, go to Control Panel - Region and Language - Advanced Settings - Numbers - and change the Decimal Symbol from "," to "." Good luck!

Upvotes: 0

Jonas Heidelberg
Jonas Heidelberg

Reputation: 5024

As pointed out by others, Excel interprets some of your data as a date instead of a number, which depends on your regional settings. To avoid this happening try Tiago's and stema's responses, they will work depending on your regional settings.

To repair your problem in a large file after it has happened without re-entering/re-importing your data, you can use something like

=DAY(B5)+MONTH(B5)/100

to convert a "date" back to a number. Excel will still display it as a date when you first enter this, but when you reformat it as "Number" now it will display the value you originally entered.

Since your column seems to contain a mix between correct numbers and dates, you need to add an if() construct to separate the two cases. If you haven't changed the display format yet (i.e. it still displays 31.Aug) you can use

=IF(LEFT(CELL("format";B7);1)="D";DAY(B7)+MONTH(B7)/100;B7)

which checks if the format is a "D"ate format. If you have already changed the format to Number, but know all your correct data is below 40000, you can use

=IF(B5>40000;DAY(B5)+MONTH(B5)/100;B5)

Upvotes: 0

stema
stema

Reputation: 93036

Internally Excel stores Dates as integer. 1 is January 1. 1900. If you entered something that Excel interprets as a date then it will be converted into an integer. I think from this point on there is no way back.

There is an setting in Options on the tab "international" where you can define your decimal separator. If you set this to ".", then your Excel should accept 30.12 as decimal number and not as date.

Upvotes: 0

Tiago Cardoso
Tiago Cardoso

Reputation: 2107

How's your regional settings? There are some Regions where the short date is identified by dd.mm.yyyy. (Estonian, for instance). Maybe if you change the regional settings for US / UK and paste the data again it won't be changed.

Worked in a small test I did here. Hope it helps.

Upvotes: 1

Related Questions