# Function for column that assigns a number (increasing) based on duplicate data

1. ## Function for column that assigns a number (increasing) based on duplicate data

Hello,

I am hoping to get help with a formula that will assign a value based on if the data in a separate column is a duplicate of the previous row.

If the current row is not a duplicate of the previous row, I want the function to assign a number of 1. If it is a duplicate of the previous row, I want the number 2 assigned - where this number increases in an increment of one until new data appears and the numeration resumes at a value of 1.

I have attached a sample excel file that demonstrates what I need to see with the data - just looking for a formula that automates the value in COLUMN B as I have thousands of rows of data.

Thank you!!!

2. ## Re: Function for column that assigns a number (increasing) based on duplicate data

Hi & welcome to the board.
Should the B23 be 1 or should it be 3 as there are two further instances of that date A7 & A8?

3. ## Re: Function for column that assigns a number (increasing) based on duplicate data

Should be 1 - I only want it to change from a 1 if the duplicates are consecutive. Sorry should have clarified this in the post.

4. ## Re: Function for column that assigns a number (increasing) based on duplicate data

Formula:
`Please Login or Register  to view this content.`

5. ## Re: Function for column that assigns a number (increasing) based on duplicate data

Oh wow I was really over-complicating that. That works - thank you so much!

6. ## Re: Function for column that assigns a number (increasing) based on duplicate data

You're welcome & thanks for the feedback.

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