提示:其他語言是Google翻譯的。 你可以訪問 English 版本。
登入
x
or
x
x
註冊
x

or

如何在Excel中分配序列號以復製或唯一的值?

如果您有包含一些重複值的值列表,我們是否可以將序列號分配給重複值或唯一值? 這意味著給出重複值或唯一值的連續順序,如下圖所示。 本文將介紹一些簡單的公式,以幫助您在Excel中解決此任務。

doc分配重複的唯一1

使用公式分配序列號以重複值

使用公式將序列號分配給唯一值

Office選項卡在Office中啟用選項卡式編輯和瀏覽,使您的工作更輕鬆......
Kutools for Excel解決了您的大多數問題,並使您的生產率提高了80%
  • 重用任何東西: 將最常用或最複雜的公式,圖表和其他任何內容添加到您的收藏夾中,並在將來快速重複使用它們。
  • 超過20文本功能: 從文本字符串中提取數字; 提取或刪除部分文本; 將數字和貨幣轉換為英語單詞...
  • 合併工具:多個工作簿和表格合二為一; 合併多個單元格/行/列而不丟失數據; 合併重複行和總和...
  • 拆分工具:根據價值將數據拆分為多個表格; 一個工作簿到多個Excel,PDF或CSV文件; 一列到多列......
  • 粘貼跳過 隱藏/過濾行; 數和總和 按背景顏色; 創建郵件列表和 通過Cell的價值發送電子郵件...
  • 超級過濾器: 創建高級過濾方案並應用於任何工作表; 分類 按週,日,頻率等; 過濾 通過大膽,公式,評論......
  • 超過300強大的功能; 與Office 2007-2019和365一起使用; 支持所有語言; 在您的企業或組織中輕鬆部署。

箭頭藍色右泡 使用公式分配序列號以重複值

要訂購重複值,請使用以下公式:

輸入這個公式: = COUNTIF($ A $ 2:A2,A2) 放到數據旁邊的空白單元格中,然後將填充手柄向下拖動到您要應用此公式的單元格,並根據重複值指定單元格值,請參閱截圖:

doc分配重複的唯一2


箭頭藍色右泡 使用公式將序列號分配給唯一值

要將序列號分配給唯一值,下面的公式可能會對您有所幫助:

輸入這個公式: =IF(COUNTIF(A$2:A2,A2)=1,MAX(B$1:B1)+1,VLOOKUP(A2,A$1:B1,2,0)) 放到數據旁邊的空白單元格中,然後將填充手柄向下拖到要應用此公式的單元格中,並且唯一值的排序順序如下所示:

doc分配重複的唯一3

筆記:

1。 在上面的公式中, A2 單元格是否包含要分配的值, B1 是你的公式所在的上述單元格。

2。 這些公式也可以應用於排序列表中的值,並且您可以根據需要獲得以下結果:

doc分配重複的唯一4


Kutools for Excel解決了您的大多數問題,並使您的生產率提高了80%

  • 重用: 快速插入 複雜的公式,圖表 以及你以前用過的任何東西; 加密單元格 密碼; 創建郵件列表 並發送電子郵件...
  • 超級方程式酒吧 (輕鬆編輯多行文字和公式); 閱讀佈局 (輕鬆讀取和編輯大量單元格); 粘貼到過濾範圍...
  • 合併單元格/行/列 不丟失數據; 分裂細胞含量; 組合重複的行/列...防止重複的細胞; 比較範圍...
  • 選擇複製或唯一 行; 選擇空行 (所有細胞都是空的); 超級查找和模糊查找 在許多工作簿中; 隨機選擇......
  • 精確複製 多個單元格而不更改公式參考; 自動創建參考 多張表; 插入項目符號,複選框等等......
  • 提取文本,添加文本,按位置刪除, 刪除空間; 創建和打印分頁小計; 在單元格內容和註釋之間轉換...
  • 超級過濾器 (將過濾方案保存並應用到其他工作表); 高級排序 按月/週/日,頻率等; 特殊過濾器 用粗體,斜體......
  • 結合工作簿和工作表; 根據鍵列合併表; 將數據拆分為多個表格; 批量轉換xls,xlsx和PDF...
  • 超過300強大的功能。 支持Office / Excel 2007-2019和365。 支持所有語言。 在您的企業或組織中輕鬆部署。 全功能30天免費試用。
kte tab 201905

Office選項卡為Office提供選項卡式界面,使您的工作更輕鬆

  • 在Word,Excel,PowerPoint中啟用選項卡式編輯和閱讀,Publisher,Access,Visio和Project。
  • 在同一窗口的新選項卡中打開並創建多個文檔,而不是在新窗口中。
  • 通過50%提高您的工作效率,每天為您減少數百次鼠標點擊!
官方底部
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    YT Kong · 2 months ago
    Hello there,

    If i want the formula to have alphabet infront is it possible?

    DO123455 =A1
    DO123455 =A1
    DO223344 = A2
    DO223344 = A2
    DO567890 = A3

    Appreciate if you can assist on my problem.

    Thank you

    YT Kong
  • To post as a guest, your comment is unpublished.
    Cesar · 3 months ago
    Hi, i want some help, i need my data right this:

    A 1
    A 2
    A 3
    B 1
    B 2
    C 1
    D 1
    C 1
    C 2
    B 1
    E 1
    E 2
    A 1
    I need taht when it finds a new value starts since 1, every time. Is it posible ?
  • To post as a guest, your comment is unpublished.
    Miskin · 6 months ago
    I want serial number start from 1 when it encounter new series
    Like
    AA - 1
    BB - 1
    AA - 2
    CC -1
    DD -1
    AA - 3
    BB - 2

    Is this possible?
  • To post as a guest, your comment is unpublished.
    Eric · 9 months ago
    Is it possible to do this with power query, and not with the vlookup formula?
  • To post as a guest, your comment is unpublished.
    Alex · 1 years ago
    Is it possible to assign such serial numbers within the same cell? I have a sheet that does this using a macro, but I cannot access the macro (password protected) to see how they did it.
    Disclaimer: I have permission to access the macros, but it is an old sheet and the passwords are lost.
  • To post as a guest, your comment is unpublished.
    MIDHIN C R · 1 years ago
    hai pls help

    i have a series of data and i want this type of results
    item product sequence number
    a powder 1
    a juice 2
    b preprocess 2
    b process 3
    b jucie 1
    c powder 1
    c juice 2
    c preprocess 3
    c procss 4


    want sequence number based on item and product column
  • To post as a guest, your comment is unpublished.
    JohnHambright · 1 years ago
    CA-01.1
    CA-01.2
    CA-01.3
    CA-01.4
    CA-01.5
    CA-01.6
    CA-01.7
    CA-02.1
    CA-02.2
    CA-02.3
    CA-02.4
    CA-02.5
    CA-02.6
    CA-02.7
    CA-02.8
    CA-02.9
    CA-02.10
    CA-02.11
    CA-03
    CA-03
    CA-03
    CA-03
    CA-03


    I need to continue this auto-fill in sequential order for hundreds of CA-##s, please help.


    Thanks!
  • To post as a guest, your comment is unpublished.
    autumn dell · 1 years ago
    I have a series of data and I want to assign every data which repeat more than 6 times in a row with the value zero. How can I do it? plz, help me out?
  • To post as a guest, your comment is unpublished.
    tejenndra · 2 years ago
    i have this data in sheet1, i work in this sheet on daily basis.

    after that i make New Sheet on State Wise Name Like DL, UK, JK, MH etc.
    is there any formula who automatic record State entry in State sheet, Like All DL related entry automatic record in DL Sheet.
    ID I2 I3 I4 STATE
    101 a j 99 DL
    102 b k 55 UK
    103 c l 44 JK
    104 d m 22 MH
    105 e n 33 DL
    106 f o 77 WB
    107 g p 25 DL
    • To post as a guest, your comment is unpublished.
      skyyang · 2 years ago
      Hello, tejenndra,
      As your problem, may be the Kutools for Excel's Split Data feature can help you. With the Split Data utility , you can quickly split the data from one sheet to others based on column or row.

      Take your data for example, after applying the Split Data feature, you will get the following result:

      Please let me know if this can help you! Thank you!
  • To post as a guest, your comment is unpublished.
    Brandon · 2 years ago
    I have a column with the same #s listed, but when the formula reaches a duplicate number, it gives an #N/A.


    --Order-- --Serial--
    --1132595277-- --1--
    --1132595201-- --2--
    --1132595277-- --#N/A--
    • To post as a guest, your comment is unpublished.
      skyyang · 2 years ago
      Hi, Brandon,
      I have tested your example in my workbook, but the formulas work well, can you attach your file or try the formulas again?
      Thanks! (a)
  • To post as a guest, your comment is unpublished.
    BUNLEE CHAN · 2 years ago
    in case there are 2 values, i have apply with below formula, but assign unique is going to be error for duplicate value1 & value2, could you pls help advise how to deal with this?

    =IF(COUNTIFS($A$2:A7,A7,$B$2:B7,B7)=1,MAX($C$1:C6)+1,VLOOKUP(A7&B7,$A$1:C7,2,0))

    Ex:

    Value1 Value 2 Assign unique
    AA 11 1
    BB 22 2
    AA 11 #N/A
    • To post as a guest, your comment is unpublished.
      skyyang · 2 years ago
      Hello,

      If you have multiple columns need to use, first, you can combine the columns into a new helper column by using this formula:=A2&" "&B2,and then apply above
      formula based on the helper column. you will get the result as you need.


      Here is an image example, hope it can help you, thank you!