How to increment numbers when value changes in another column?

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:
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.
After installing "Kutools For Excel", please click "Kutools" > "AI Aide" to open the "Kutools AI Aide" pane.
- 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 - 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
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!