Is this a bug? Numbers as text sort…

evert

Board Regular
Joined
Dec 11, 2007
Messages
64
In one of my sheets I have column A defined as Text format. Then I type in numbers:
34
22
58
Then I sort column A, and then the numbers are sorted fine.

I have another helpsheet with numbers:
12
13
88
The cell format in this helpsheet is General.

I paste these numbers into column A of the first sheet, using the options Paste Special -> values.
So now in the first sheet column A we have:
22
34
58
12
13
88

Then I sort by column A, resulting into:
12
13
88
22
34
58

This is not good since 88 was supposed to end up below.

Excel somehow remembered the original number format of 12, 13 and 88 when I pasted specially as values. I know when I would have typed 12, 13 and 88 directly, the sorting would have had the expected result.
Is this a bug?
I'm using Excel 2000.
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
It's because the first set of numbers (12,13,88) are not really numbers. They are TEXT strings that look like numbers (Numbers Stored As Text).

Text and numbers are sorted differently. When choosing Ascending, Text comes first, numbers last.


Try this in an adjescent column

=A1*1

And fill down to the end of the data.

Now that column will be all numbers, and you can sort by that column.
 
Upvote 0
OK, I said that backwards.
34,22,58 are the numbers stored as text
and the actual numbers 12,13,88 are sorted first when sorting ascending...
 
Upvote 0
Still I would have expected that pasting as VALUE would have turned the numbes also into TEXT strings that look like numbers:confused:
 
Upvote 0
Paste special values pastes exactly what was copied.

If text was copied (even numbers stored as text), it's pasted as text.
If numbers were copied, it's pasted as numbers.

You can try using Data - Text to columns to convert the "Numbers Stored As Text" to actual numbers.
 
Upvote 0

Forum statistics

Threads
1,207,091
Messages
6,076,522
Members
446,212
Latest member
KJAYPAL200

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