+ Reply to Thread
Results 1 to 4 of 4

Counting in groups or bunches

  1. #1
    Registered User
    Join Date
    07-19-2011
    Location
    Boston, MA
    MS-Off Ver
    Excel 2007
    Posts
    5

    Exclamation Counting in groups or bunches

    Hey guys,

    I am trying to create unique SKUs for a data set I have. What I would like to accomplish is to create a new SKU for every new product. These SKUs should be numerical but I cannot use the drag tool or a basic formula because each product takes up anywhere between 2-50 rows. Each row may depict a different color/size but it is still the same product and needs the same SKU.

    Example
    E1-E5: "Writing Desk"
    E6-E12: "Bookcase"
    E13-E50: "Barstool"

    Now what I want would be...
    D1-D5: "SKU10001"
    D6-D12: "SKU10002"
    D13-D50: "SKU10003" and so on...

    I tried coming up with a COUNTIF formula but to no avail. Ideas I have about how to do it would be If E2=E1, don't count up. If E2≠E1, count. That way it checks the cell above. If the cell above is the same it doesn't count up, if the cell above is different (meaning a change in product), the SKU will count up by 1.

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Counting in groups or bunches

    in d1 put
    sku10001
    in d2
    put
    ="sku"&IF(E2=E1,RIGHT(D1,5),RIGHT(D1,5)+1) drag down
    Last edited by martindwilson; 07-19-2011 at 05:20 PM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    07-19-2011
    Location
    Boston, MA
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Counting in groups or bunches

    FANTASTIC!

    Martin, thank you kind sir.

    And for others who may use this after, in d1 put "SKU10001" with no = sign. That messed me up for a few minutes.

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Counting in groups or bunches

    oops a typo

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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