Consulting

Results 1 to 6 of 6

Thread: IF formula for identifying unique rows (quite confusing problem)

  1. #1

    Question IF formula for identifying unique rows (quite confusing problem)

    I have a good question here, can someone help?

    I have 2 columns I want to uniquely identify here.

    Take columns B and C for this example.

    Here's an example of this dilemma:

    Printer model | Cartridge code

    Dell 725 | 592-10177
    Dell 810 | 592-10177

    I want to uniquely identify these 2 rows, so I can put an ID number in each one.

    Where the layout would be like so:

    Category ID | Printer Model | Cartridge Code

    If there isnt a number above the current ID, like for the 1st row, then use 1 and if there is one above, add 1 to the existing value.

    How would this be possible, can someone help?

    Thanks for any replies in advance,
    Jeremy.

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Type 1 in row 1, 2 in row 2, select both of them, then just autofill down.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3

    Question

    Thanks ever so much for that reply.

    I forgot to mention however, my data is stripped over 2 sheets in an excel workbook.

    Is there anyway of making a formula look at the last value of the ID column say on sheet 2, like so:

    Sheet1 (contains the ink's x reference):

    cat ID | cat name
    1 | cat1
    2 | cat2
    3 | cat3
    4 | cat4

    Then Sheet 2 will follow on from that:
    cat ID | cat 5
    5 | cat5
    6 | cat6
    and so on....

    Is there anyway of doing this in an excel formula?

    Thanks again in advance,
    Jeremy.

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Sheet2:

    A2: =MAX(Sheet1!A:A)+1
    A3: =A2+1

    Copy A3 down
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5

    Question

    Actually scratch both of those ideas I had!

    They wouldnt simply work for the concept I am looking at, at all to be fair!

    I must apologise, as I only saw this when I was trying to get the macro to pick these ID's up, then I can see the errors in my ways as it where.

    Take this example just as a concept yea?

    Category name | Cartridge
    Category 1 | Cartridge1
    Category 1 | Cartridge2
    Category 1 | Cartridge3

    Category 2 | Cartridge1

    So it would look like:
    Cat ID | Cat Name | Cartridge Name
    1 | Category 1 | Cartridge1
    1 | Category 1 | Cartridge2
    1 | Category 1 | Cartridge3

    2 | Category 2 | Cartridge 1

    Is there anyway of making excel from a formula, work out when a user types in a value into Cat Name field yea?

    That it checks the value the user has just inputted, if that value is exactly the same in the above row, then display the same ID number.

    If it doesnt then add 1 up to that value, like the above example as it where.

    I hope this makes sense.

    Thanks for any replies in advance,
    Jeremy

  6. #6
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Hi Jeremy,
    Post a sample workbook showing what you are after, with explanatory notes. This doesn't sound difficult, but a clearer understanding would help.
    Regards
    MD
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

Posting Permissions

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