Skip to main content

How to increment numbers when value changes in another column?

Author Xiaoyang Last modified
increment numbers when value changes

When managing data in Excel, you may encounter scenarios where you need to assign incrementing numbers based on changes in another column. For example, in the provided dataset, each group of identical values in column A has a unique sequence of numbers in column B. This guide explains how to accomplish this step-by-step.

Use a formula to increment numbers based on group value changes

Use Kutools AI to increment numbers based on group value changes


Use a formula to increment numbers based on group value changes

To increment numbers based on another column when value changes, the following simple formula may help you.

1. Enter any one of the dollowing formula into a blank cell which beside your data, "B2", for instance, see screenshot:

=IF(A2<>A1,1,B1+1)
=COUNTIF($A$2:A2,A2)

2. Then drag the fill handle down to fill the sequence numbers. The numbering will restart each time the value in column A changes. See screenshot:

drag the fill handle down to other cells


Use Kutools AI to increment numbers based on group value changes

"Kutools for Excel" provides an easy and powerful way to increment numbers automatically when values change in a column. With its "Kutools AI Aide", you can simply describe your requirement in natural language, and "Kutools AI" will handle the rest for you. This eliminates the need for manual setup and ensures accurate results in seconds. It's an ideal solution for those who want to save time and avoid complex formula-based setups in Excel.

Kutools for Excel offers over 300 advanced features to streamline complex tasks, boosting creativity and efficiency. Itegarate with AI capabilities, Kutools automates tasks with precision, making data management effortless. Detailed information of Kutools for Excel...         Free trial...

After installing "Kutools For Excel", please click "Kutools" > "AI Aide" to open the "Kutools AI Aide" pane.

  1. Type the requirement in the chat box: such as:
    Increase numbers for each group in column A, and put the numbers in column B starting from B2
  2. And then, press "Enter" key or click the "Send" button. "Kutools AI" will analyze the question, after finishing, please click "Execute" button to get the result.

With these methods, you can efficiently increment numbers in Excel whenever the value in another column changes. This approach is versatile and can be applied to datasets of various sizes. Whether you prefer formulas or Kutools AI, the solution ensures accurate and optimized results. If you're interested in exploring more Excel tips and tricks, our website offers thousands of tutorials.


Best Office Productivity Tools

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more
Use Kutools in your preferred language – supports English, Spanish, German, French, Chinese, and 40+ others!

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...


Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!