Autonumbering base on the same item on field

dhen21dx

Board Regular
Joined
May 10, 2013
Messages
166
Hello, just want to ask if we can have an autonumbering of same item in fields, the scenario is that i have a query to append on the table, but i need autonumber the item that is same on 1 field.

AutonumberItemDescription
1​
Orangesssss
2​
Orangexxcccc
1​
Bananaqwd
1​
Applewqdxqwd
3​
Orangeqdwqw
2​
Appleqwdqwsdwqw
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
out of curiosity, what do you need that for? If you have an autonumber, you can always create a query that groups by item and sorts by the autonumber you gave, or does any other functionality.
 
Upvote 0
My purpose of it is that making a version on that specific field(key identifier), let say there is/are a change/s on other fields then we can trace the version of it where it changed.
 
Upvote 0
couldn't you still do that with a regular auto-number? It wouldn't be 1,2, and so on for Oranges, but more like 1, 5, 21, or whatever. Point is it is still sorted in numerical order and when you do a sort by, you will get equivalent results.
 
Upvote 0
No, because the query i created consist on different let say fruits, we can also introduce new fruits that is not yet in the history table. I mean i need to identify the field from the history and its last number so i can make a new lastnumber on current one. let say here are example.

Making Orange(current query) as 4 append to History table, Apple as 3 and Grapes as 1..

History Table
AutonumberItemDescription
1Orangesssss
2Orangexxcccc
1Bananaqwd
1Applewqdxqwd
3Orangeqdwqw
2Appleqwdqwsdwqw

(Current query) Item to append on History table
ItemDescription
Orangerrrrrrrrr
Applexxxxxxxx
Grapesddddaa
 
Upvote 0
if we can have an autonumbering of same item in fields
You could do this in a query, which would make this dynamic, but not in a table as an autonumber. I'm not understanding the need though, so if you must store these values for some sort of history reason you will have to use a regular number field (integer or long) as a table field. When adding a new instance of a "fruit" value, your append query would find the Max value for that fruit, add 1 to it, and write that value along with the fruit.
 
Upvote 0
Hello,

So assigning the number will be on the query and make the table as data type number only right?, then my criteria in query will be if Current_table (field 1) = History_Table (field 1), then Max (field_version)+1. Am i correct?
 
Upvote 0
That is correct. So far none of your explanations of why you need this is very convincing though - its a more complicated to way to do an insertion and makes it dependent on using the right insertion query all the time. That said, it will work of course and the query is not hard to write, just not as simple as autonumbering or using a datetime field to keep track of when things were inserted.
 
Upvote 0

Forum statistics

Threads
1,225,322
Messages
6,184,277
Members
453,226
Latest member
wkrasl

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