How to increment numbers when value changes in another column?
Supposing, you have a list of values in column A, and now you want to increment number by 1 in column B when the value in column A changes, which means the numbers in column B increment until the value in column A changes, then the number increment starts from 1 again as left screenshot shown. In Excel, you can solve this job with following method.
To increment numbers based on another column when value changes, the following simple formula may help you.
1. Enter this formula: =IF(A2<>A1,1,B1+1) into a blank cell which beside your data, B2, for instance, see screenshot:
2. Then drag the fill handle down to the cells that you want to fill sequence numbers and restart for every change in column A, see screenshot:
Note: Here is another formula =COUNTIF($A$2:A2,A2) also can help you to create a number sequence that restarts for every change in another column.
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!