+ Reply to Thread
Results 1 to 13 of 13

How to assign unique numbers from 1 - 99 to duplicate or unigue values in one column

  1. #1
    Registered User
    Join Date
    05-05-2016
    Location
    SLovakia
    MS-Off Ver
    2010
    Posts
    16

    How to assign unique numbers from 1 - 99 to duplicate or unigue values in one column

    Hello,

    I am trying to assign unique numbers from 1-99 in column A by a formula for which the base should be unique and duplicate values in column B. Can you please help me with the formula? Value or Count? Below and attached I have already inserted in column A how I imagine it.

    Also I would need to do the same but now in column C I have unique and duplicated values as well. I need to assign a number from 1 - 99 as I have showed attached.

    Would you please inform how to do this?

    A B A B C
    1 123 1 123 11
    1 123 2 123 12
    2 124 3 124 13
    3 125 4 125 14
    4 126 5 126 15
    5 127 6 127 16
    5 127 6 127 16
    5 127 7 127 17



    EXCEL NR..JPG

  2. #2
    Valued Forum Contributor
    Join Date
    11-02-2016
    Location
    NY
    MS-Off Ver
    2010
    Posts
    459

    Re: How to assign unique numbers from 1 - 99 to duplicate or unigue values in one column

    Start in Column A, in A2 manually assign the first number 1. In second row of data (Cell A3) ~ have formula =IF(B3=B2,A2,A2+1) and COPY down. The formula looks at ROW 3: if the ORDER is the same (123 which it is!) then copy the number above it, ELSE if the ORDER is different (ROW 3 is NOT) add 1 to the number above it. [for the number to change/add 1 to it, look at row 4].

  3. #3
    Registered User
    Join Date
    05-05-2016
    Location
    SLovakia
    MS-Off Ver
    2010
    Posts
    16

    Re: How to assign unique numbers from 1 - 99 to duplicate or unigue values in one column

    Hi,

    Thanks for the reply. Shouldnt the formlula be however =IF(B3=B2,"A2",A2+1)? Because it does not work the way you mentioned above.

    Thanks

  4. #4
    Valued Forum Contributor
    Join Date
    11-02-2016
    Location
    NY
    MS-Off Ver
    2010
    Posts
    459

    Re: How to assign unique numbers from 1 - 99 to duplicate or unigue values in one column

    I don't believe so. The formula worked when I copied it from the forum and pasted it. Perhaps it might be best to have a PLUS sign in front of A2 updated to =IF(B3=B2,+A2,A2+1). In any event, it is probably more important to understand how to arrive at the formula so that you can use it in other situations. Just hope it helped...if it did please hit the STAR for ADD REPUTATION. Thanks

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,917

    Re: How to assign unique numbers from 1 - 99 to duplicate or unigue values in one column

    As soon as you put "" around a cell ref, it is no longer a cell ref, but just regular text.

    The suggested formula worked for me, too...
    A
    B
    1
    blah blah 1
    2
    1
    123
    3
    1
    123
    4
    2
    124
    5
    3
    125
    6
    4
    126
    7
    5
    127
    8
    5
    127
    9
    5
    127
    10
    6
    128
    11
    7
    129
    12
    7
    129
    13
    8
    130

    with a seed of 1 in A2
    A3=IF(B3=B2,A2,A2+1)
    copied down
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  6. #6
    Registered User
    Join Date
    05-05-2016
    Location
    SLovakia
    MS-Off Ver
    2010
    Posts
    16
    I received the classic mesaage/error that "theres a problem with this formula"

    [tr][td]
    2
    [/td][td]
    1
    [/td][td]
    123
    [/td][/tr]

    [tr][td]
    3
    [/td][td]
    1
    [/td][td]
    123
    [/td][/tr]

    [tr][td]
    4
    [/td][td]
    2
    [/td][td]
    124
    [/td][/tr]

    [tr][td]
    5
    [/td][td]
    3
    [/td][td]
    125
    [/td][/tr]

    [tr][td]
    6
    [/td][td]
    4
    [/td][td]
    126
    [/td][/tr]

    [tr][td]
    7
    [/td][td]
    5
    [/td][td]
    127
    [/td][/tr]

    [tr][td]
    8
    [/td][td]
    5
    [/td][td]
    127
    [/td][/tr]

    [tr][td]
    9
    [/td][td]
    5
    [/td][td]
    127
    [/td][/tr]

    [tr][td]
    10
    [/td][td]
    6
    [/td][td]
    128
    [/td][/tr]

    [tr][td]
    11
    [/td][td]
    7
    [/td][td]
    129
    [/td][/tr]

    [tr][td]
    12
    [/td][td]
    7
    [/td][td]
    129
    [/td][/tr]

    [tr][td]
    13
    [/td][td]
    8
    [/td][td]
    130
    [/td][/tr]
    [/table][/size]
    with a seed of 1 in A2
    A3=IF(B3=B2,A2,A2+1)
    copied down[/QUOTE]

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,917

    Re: How to assign unique numbers from 1 - 99 to duplicate or unigue values in one column

    exactly what are you putting in the cell (A3)?

  8. #8
    Registered User
    Join Date
    05-05-2016
    Location
    SLovakia
    MS-Off Ver
    2010
    Posts
    16
    Hello please find attached the formula that i am using
    Attached Images Attached Images

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,368

    Re: How to assign unique numbers from 1 - 99 to duplicate or unigue values in one column

    Change the commas (,) to semi-colons (; ).
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  10. #10
    Registered User
    Join Date
    05-05-2016
    Location
    SLovakia
    MS-Off Ver
    2010
    Posts
    16

    Re: How to assign unique numbers from 1 - 99 to duplicate or unigue values in one column

    Great thank you veymuch it worked
    😀 what if i have data in 2 colums as shown above in my table with orders and deliveries

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,368

    Re: How to assign unique numbers from 1 - 99 to duplicate or unigue values in one column

    Will you please attach a sample Excel workbook? We are not able to work with or manipulate a picture of one.

    1. Make sure that your sample data are REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired solution is also shown (mock up the results manually).

    3. Make sure that all confidential data is removed or replaced with dummy data first (e.g. names, addresses, E-mails, etc.).

    4. Try to avoid using merged cells as they cause lots of problems.

    Unfortunately the attachment icon doesn't work at the moment, so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

    Please pay particular attention to point 2 (above): without an idea of your intended outcomes, it is often very difficult to offer appropriate advice.

  12. #12
    Registered User
    Join Date
    05-05-2016
    Location
    SLovakia
    MS-Off Ver
    2010
    Posts
    16

    Re: How to assign unique numbers from 1 - 99 to duplicate or unigue values in one column

    Hello thank you very much for your support in advance. The logic is that
    I have values in column B and C and if the value in column B and C (in one specific row) are the same
    I need to put the same number (eg. 1). If not and for example the values in B2 + B3 are the same but the values in C2 + C3
    are not than in A1 + A2 I would need to see two different numbers (eg 1 and 2) as attached.

    Thank you in advance

  13. #13
    Registered User
    Join Date
    05-05-2016
    Location
    SLovakia
    MS-Off Ver
    2010
    Posts
    16

    Re: How to assign unique numbers from 1 - 99 to duplicate or unigue values in one column

    Hello,

    Can you please help me with the above attached?

    Thank you

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Assign sequential numbers to unique values in a list
    By penfold in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 09-30-2017, 02:11 PM
  2. [SOLVED] Putting a zero in column B for duplicate values and 1 for unique values
    By treeantz in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-17-2016, 12:37 AM
  3. [SOLVED] Assign single number to duplicate values in column
    By excelresumes in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-19-2013, 06:05 PM
  4. [SOLVED] Assign single number to duplicate values according to a column
    By DonAx in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-18-2013, 04:45 AM
  5. [SOLVED] Count the number of unigue numbers based on number in another column.
    By ksmith4809 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-27-2013, 09:11 AM
  6. Replies: 3
    Last Post: 10-15-2012, 10:42 AM
  7. Handling duplicate values into unique and sum their next column values
    By No_feelings in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-26-2012, 05:12 PM

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