+ Reply to Thread
Results 1 to 7 of 7

Assign serial number without sorting...

Hybrid View

  1. #1
    Forum Contributor lifeisaspreadsheet's Avatar
    Join Date
    10-04-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    208

    Assign serial number without sorting...

    Just wondering if this is possible, and I think it is but the question is. How?

    I have a list of products in Column A. There are several products like Tea, Sugar, Wheat etc...This list keeps on increasing as and when new ones are added or if the stock of the same one is received with obviously other things like quantity, price, vendor etc in the columns from B onwards...

    I used the Countif function to determine how many times stock for each was received. In addition to it, I need the following:

    1) In Column BA I would like to get the serial number / sequence of each product against it. For example: If I have Wheat 5 times in column A in non- consecutive rows (Row 14, 56, 78,128, 330) I need 1, 2, 3, 4, 5 as the serial numbers in Column BA. In other words for Wheat in Row 14 the corresponding serial number should be 1, in Row 56 it should be 2 etc and for other products it should again start from 1 and end depending upon their occurence.

    Secondly, if a new product is added it should be automatically added to the listing where I have applied Countif using unique product ranges and give its count.

    The challenge is that I cannot sort the data every now and then due to some restrictions, otherwise a simple solution could have been sorting and just dragging the serial numbers.

    Hope my request is quite explanatory!

    Looking for your expertise on it!
    Last edited by lifeisaspreadsheet; 10-18-2012 at 04:43 PM.
    Experience is not what happens to you; it's what you do with what happens to you.

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Assign serial number without sorting...

    lifeisaspreadsheet,

    Assumptions:
    Row 1 is a header row
    Actual data starts in row 2

    In cell BA2 and copied down, something like this?
    =COUNTIF(A$2:A2,A2)
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,489

    Re: Assign serial number without sorting...

    HTML Code: 

    Make it a table; the formula should automatically be copied down when you add a row.


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,489

    Re: Assign serial number without sorting...

    And, if you did sort the records:

    HTML Code: 

    Regards, TMS

  5. #5
    Forum Contributor lifeisaspreadsheet's Avatar
    Join Date
    10-04-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    208

    Re: Assign serial number without sorting...

    Super! This was very simple. sometimes the brain just doesn't function, as in when you think too much, and that's what I did. LOL!...Thanks:-)

    One more on this one and this has been an ongoing problem...that haven't been able to get resolution to.

    I need to be able to auto populate the data entered in one sheet to a few others. So if in this case, If I entered Mango in Column A, I need to get the same data entered in 2 ways:

    Sheet 2: Same row as sheet 1
    Sheet 3: last empty row of the data in it.

    Please advise.

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,489

    Re: Assign serial number without sorting...

    You're welcome. Thanks for the rep.


    This is a completely different question, albeit using the same data/workbook. The solution, I suspect, would require VBA ... and warrants a new thread in its own right.

    That said, I would normally advise against generating sheets with subsets of a "main" sheet. Maintenance becomes a PitA. if you must do it, the easiest way would be to use an Advanced Filter to select the products and copy them to a new location ... that is, clear the target sheet each time and copy all the data afresh.

    Regards, TMS

  7. #7
    Forum Contributor lifeisaspreadsheet's Avatar
    Join Date
    10-04-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    208

    Re: Assign serial number without sorting...

    Got it, will follow it in my future posts.

    Thanks for all this assistance!

    As always, Excel Help Forum Rocks:-)

    Marking it solved now.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1