+ Reply to Thread
Results 1 to 2 of 2

Comparing non consecutive cells to increment a character string

  1. #1
    Registered User
    Join Date
    09-02-2011
    Location
    montreal, canada
    MS-Off Ver
    Excel 2007
    Posts
    30

    Arrow Comparing non consecutive cells to increment a character string

    Hi,

    I have a spreadsheet containing parts to name. Numbering works as follows : two letters followed by 4 numbers. The first 3 characters (two letters and first number) of the part name are chosen logically depending on what type of part it is (two letters) and what circuit # it's located on (first number).

    So my sheet looks as follows :


    A B C
    Part type Circuit # Name
    DV 0
    DT 1
    DV 1
    DV 0

    The name of the first part should be DV0001, the second DT1001, the third DV1001, the fourth DV0002.

    I already know how to concatenate cells ( =A2&B2) but I want to assign the following 3 digits as the next available number (incremented) for all parts with the same type and circuit#. From a programming logic, the current NAME cell would need to look for the maximum of the last three digits of all NAME cells (column C) that have a matching string for PART TYPE and CIRCUIT#, and add +1, conserving 0s ( 008 shouldn't be 8).

    So I guess this logical formula would add on to the concatenation
    =A2&B2& ( max ( ??? ) +1)

    Anyone has something useful ?

    Thanks in advance
    Last edited by Virgule; 09-02-2011 at 04:14 PM. Reason: error

  2. #2
    Registered User
    Join Date
    09-02-2011
    Location
    montreal, canada
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Comparing non consecutive cells to increment a character string

    SOLVED


    Cell Formula
    C2 =A2&B2&TEXT(SUMPRODUCT(--($A$2:A2=A2),--($B$2:B2=B2)),"000")
    C3 =A3&B3&TEXT(SUMPRODUCT(--($A$2:A3=A3),--($B$2:B3=B3)),"000")
    C4 =A4&B4&TEXT(SUMPRODUCT(--($A$2:A4=A4),--($B$2:B4=B4)),"000")
    C5 =A5&B5&TEXT(SUMPRODUCT(--($A$2:A5=A5),--($B$2:B5=B5)),"000")


    credit goes to AlphaFrog on MrExcel.com

    Thanks

+ 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