How do I create an auto ID in Excel?

I need Some Help Can you tell me how to solve this problem in excel

my problem:

i have 3 columns like no. name and amount

i just need when i add name in column automatic add id number in "no. columns"

for example if i put name in C10 then automatic add id number in B10 and then i put again name in c13 and i want to add id number in b13

please look this image: Photo

please tell me

which formula is used for number id

               b             c             d
              no.         name          amount
         10    1         google         
         11               
         12    3         Facebook
         13    2         youtube

i just put name with ordering like 1=google and 2=youtube ......

And sorry for bad English because I don't know English well

Hello Excellers and welcome back to another #formulafriday #exceltip in my 2019 Excel tip series. Today I want to share with you a question I was asked by a subscriber. They need to generate unique ID numbers or references, from their data set. Or to explain more take the first 3 letters of the location of the account (in this case the Country) name, and then incrementally generate numbers for the accounts.

You can see a sample of a similar data set and the expected outcome that is required in the screenshot below.

How do I create an auto ID in Excel?
Generate A Unique User ID In Excel

So, just how can we achieve this result. It’s rather easy. We are going to use three formulas or methods to do do this. W. start with the CONCATENATE Function, the LEFT Function, and the COUNTIF Function. By combining these three awesome methods the unique ID is a breeze. Let’s get started.

Let’s Begin The Formula!

How do I create an auto ID in Excel?

PART 1. We start off using the CONCATENATE.

This will join several strings together into one text string. This sounds like what we need. The syntax of CONCATENATE is simple and has only one required argument.

The subsequent arguments are optional, hence the [ square] brackets.

=CONCATENATE(text1, [text2], …)

So, the first part of the formula will join the first three letters of the City contained in cells in column B. How do we get those letters?.

PART 2. We can use the LEFT Function.

Here is a quick recap of LEFT and it’s syntax.

The LEFT Function in Excel extracts a given number of characters from the left side of a supplied text string.

The syntax for this formula is

=LEFT(text, [num_chars])
Where

text is the string you want to extract from (that is the cell reference that holds your text string)

num_chars is the number of letters you want to extract from the full string.  Note the [ ] brackets.  This means that this is an optional argument, which if left out default the argument to 1.

So, in our formula, we want to take the first three (3) letters of the City Names in Column B with the header ‘City’. That is straightforward. we already have the first part of our formula, and the LEFT function becomes the first argument as below

=CONCATENATE(LEFT(B3,3),

PART 3. Add a ‘dash’ (-) to the Unique ID.

We can easily do this by inserting another argument in the CONCATENATE function.

=CONCATENATE(LEFT(B3,3),”-“

PART 4. Generate A Unique Count Of City

We now need to generate a unique last number for the end of the ID. So the fourth argument we use in the CONCATENATE formula is COUNTIF. We will use this to count how many times incrementally the City names in Column B appear. Cool huh?. COUNTIF uses a very simple syntax as there are only two arguments.

=COUNTIF(range, criteria)

The two arguments are:-

range – defines one or several cells to count. You put the range in a formula like you usually do in Excel.

criteria – defines the condition that tells the function which cells to count. This argument can be a number, text string, cell reference or expression.

So, in this example, we want Excel to count as it travels down the column of data how many times each city appears in the data. For example the first time the City London appears we want Excel to place 1 in our cell. The second time it appears we it to count and put 2 in the cell and so on and so forth. How do we do this?. Easy. We make the criteria that Excel uses dynamic.

To complete the formula for our first cell, we use the formula

=CONCATENATE(LEFT(B3,3),”-“,COUNTIF($B$3:B3,B3))

Where the range of the COUNTIF formula is $B$3:B3,B3. By anchoring the first cell of the range, the range which Excel analyses is expanded as we drag the formula down the column of cells. So, the first time Excel looks for LONDON the range of cells it is referencing is just the one, hence it generates 1. By the time it finds the second entry of LONDON the range it is looking in has been expanded to $B$3:B7,B7, and so on and so forth.

You can see this demonstrated clearly in the screencast below. The green arrows indicate the expanding range of cells.

An Expanding Range In Excel Formula

So, now we have the unique ID for each customer record by combining CONCATENATE, LEFT and COUNTIF Functions. A nice solution don’t you think?.

What Next? Want More Tips?

How do I create an auto ID in Excel?

So, if you want more top tips then sign up for my Monthly Newsletter where I share 3 Tips on the first Wednesday of the month and receive my free Ebook, 30 Excel Tips.

How do I create an auto ID in Excel?

Do You Need Help With An Excel Problem?.

I am pleased to announce I have teamed up with Excel Rescue, where you can get help FAST.

How do I create an auto ID in Excel?

How do I automatically add an ID in Excel?

Fill a column with a series of numbers.
Select the first cell in the range that you want to fill..
Type the starting value for the series..
Type a value in the next cell to establish a pattern. ... .
Select the cells that contain the starting values. ... .
Drag the fill handle..

How do I generate ID numbers in Excel?

type 1 into the cell which is adjacent to the first data you want to add ID number. 2. Then in the cell below it, type this formula =IF(B1=B2,A1,A1+1), press Enter key to get the first result, drag fill handle down until last data showing up.