Solved

Assign a number to each group of unique values in a column.

Posted on 2011-03-15
1
666 Views
Last Modified: 2012-05-11
I have 43,504 rows of data.
Row 1 contains column headers.

I want Column A to have an "ID" number (starting with a value of "1" in A2 and ascending by "1") based on the value of Column B.

Start by comparing B2 to B3.
If B2 and B3 are the same, label A3 as "1".
If B2 and B3 are NOT the same, label A3 as "2" (=A2+1).
(then compare B3 to B4)
If B3 and B4 are the same, label A4 as "1" (=A3)
If B3 and B4 are NOT the same, label A4 as "2" (=A3+1)
(continue until a blank cell/row is reached.)

For example, the 2nd and 3rd rows of Column B contain "57827". I want these 2 rows of Column A to contain the value of "1".
The  4th row through 11th row of Column B contain "61034". I want these rows in Column A to contain "2".

ID-Value-Example.jpg
0
Comment
Question by:nicholasjwolf
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 81

Accepted Solution

by:
zorvek (Kevin Jones) earned 500 total points
ID: 35142456
Place in A2:

   1

Place in A3 and copy down:

   =IF(B2=B3,A2,A2+1)

Kevin
0

Featured Post

Ready to get started with anonymous questions?

It's easy! Check out this step-by-step guide for asking an anonymous question on Experts Exchange.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question