Cells keep insisitng on showing as dates

therock003

Board Regular
Joined
Jan 9, 2008
Messages
183
I have set a table to store some data and in one column i store proeuct codes. Weirdly enough the formar code is XX-XX-XX where xx is a number from 00-99. As you can imagine some get recognised as dates by excel. For example 35-42-67 is not an acceptable input for date, but lets say an item had the product code of 10-10-03 which coincidentally is the date equivalent of 10 october of 2003. I have of course gone to cell formatring and turn this entire column to text input or other formata but still the exclamation pops up that its a suspicious entry and thus when i sort this column everything gets messed up. Have you got any solutions for this
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Rich (BB code):
when i sort this column everything gets messed up

Not able to follow what happens. Update the image before an after sort

For exclamation pops up Select all cells and ignore error.
 
Upvote 0
There is an option that you can change which will stop this happening, but it will apply to excel as a whole, not just that specific column.

File > Options > Formulas > Error checking rules. Uncheck 'Cells containing years represented as 2 digits'

Another option would be to use a custom date format that matched the product code format, but that would likely cause problems elsewhere, especially with the sorting and any formulas that refer to the codes.

edit:-

If the cells are pre-formatted as text then it should not affect sorting, but you will still see the error warnings.
 
Upvote 0
For exclamation pops up Select all cells and ignore error.
Just to say that you have to ignore the error on the first cell in the selection to clear the error indicator on all the cells. If you ignore the error on any other cell it will just clear it from that cell.
 
Upvote 0
Thanx for your replies. Guys as i said i use the xx-xx-xx format for item codes. I unchecked the cells represented by last two digits and error dissapeared. But i still have problems with sorting.

Welp in order to further explaining. I need to sort my tables based on code number so when a client asks for a product, the eye gets directly on top of things, instead of searching and control effing all over the place. So i need to sort from lower to higher. So.... Lets say i have 4 codes

21-05-01, 16-05-01, 15-75-04 and 10-40-08. So if i sort alphabetically the list will become

10-40-08, 15-75-04, 16-05-01 and 21-05-01

but at the moment it lists them as:

16-05-01, 21-05-01, 10-40-08 and 15-75-04

So as you can see, it detects 16-05-01 and 21-05-01 as dates and it prioritises them in sorting. Although ive clearly set their formating as text ,and unchecked the error checking for date format
 
Upvote 0
Formatted as text and sorted in ascending order, this is what I get.
Book1
A
1Code
210-40-08
315-75-04
416-05-01
521-05-01
Sheet1


I've tried sorting A-Z and Z-A, both with normal ranges and tables. Everything is sorting correctly, not sure why yours is different. Only thing that comes to mind is that it is sorting by the wrong column if you are trying to sort a table.
 
Upvote 0
Formatted as text and sorted in ascending order, this is what I get.
Book1
A
1Code
210-40-08
315-75-04
416-05-01
521-05-01
Sheet1


I've tried sorting A-Z and Z-A, both with normal ranges and tables. Everything is sorting correctly, not sure why yours is different. Only thing that comes to mind is that it is sorting by the wrong column if you are trying to sort a table.

Yes it is on a table
 
Upvote 0
For the reason that I said maybe?
Only thing that comes to mind is that it is sorting by the wrong column if you are trying to sort a table.
In this case I was referring to data that looks like a table rather than an actual data table. If you select say 4 columns of data, then click the sort arrow then it might not be sorting by the column that you want it to.

I have not been able to make it sort incorrectly when all of the codes are formatted as text so I'm trying to think of reasons why yours might behave differently.
 
Upvote 0
For the reason that I said maybe?

In this case I was referring to data that looks like a table rather than an actual data table. If you select say 4 columns of data, then click the sort arrow then it might not be sorting by the column that you want it to.

I have not been able to make it sort incorrectly when all of the codes are formatted as text so I'm trying to think of reasons why yours might behave differently.
No im using an actual data srt formatted as a tablr and im sorting by selecting the desired column. Its so weird to me that im not getting the desired effect
 
Upvote 0

Forum statistics

Threads
1,214,951
Messages
6,122,446
Members
449,083
Latest member
Ava19

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