Excel Insider
Excel Pro Tips

How To Find First Occurrence of a Value in a Column in Excel

Written by:Rudra Nil UtsaRudra Nil Utsa
Last Updated:
Share

In statistics, an analyst might want to find from which cell in a column some value started to show up. To do so, it is required to find the first occurrence of a value in a column in excel. This article will show you five ways, including formulas and explanations, to accomplish your task.

Key Takeaways
➤ Take a helper cell
➤ Write the formula:
=MATCH("Emily Johnson", A:A, 0)
➤ Replace A:A with your column, and “Emily Johnson” with your value.

That was one way of doing that. But we have four more ways ready for you so that you can clearly understand how each function works and even do it without functions. Therefore, consider reading the whole tutorial to get the best understanding.
overview image

1

Using the MATCH Function

Here, we have a sheet of customer feedback. There could be customers who have made repeated purchases. We want to find the first time a particular customer made a purchase. Therefore, we will look for the cell index where the first feedback was given.

Here is how to find the first instance of the customer:

➤ Take a helper cell where we will find the cell index.
➤ Enter this formula:

fx
=MATCH("Emily Johnson", A:A, 0)
Explanation
The MATCH function looks for the value in the first parameter in the range provided in the second parameter. In the third parameter, 0 defines that we want an exact match. Here, the first parameter is “Emily Johnson”, which is the customer’s name we are looking for, and A:A is for looking up the whole column A.


➤ Pressing Enter will give you the cell number where the value is found for the first time.


2

Combining  MIN, IF & ROW Functions

This time, we will use a combination of functions to find the first occurrence of the value. Read the explanation carefully to know how the formula works:

➤ Use a helper cell like before and write this formula:

fx
=MIN(IF(A:A="Emily Johnson", ROW(A:A)))
Explanation
The IF function is used for logic. Here, if the value “Emily Johnson” exists in column A:A, it will return the row numbers from the array of rows returned by the ROW function. Finally, the MIN function will return the lowest number from the array, which is bound to be the first occurrence.

3

Inserting IF-COUNTIF-MATCH Functions

This method basically uses the first method but with better error checking. Follow the steps below to use the formula:

➤ Write this formula in the helper cell:

fx
=IF(COUNTIF(A:A, "Emily Johnson") > 0, MATCH("Emily Johnson", A:A, 0), "Not Found")
Explanation
At first, the COUNTIF function returns how many times the desired value Emily Johnson is in the column (A:A). IF it’s bigger than 0, then the value exists, and we return the value using the MATCH function. If there isn’t any, it returns Not Found.


➤ Press Enter to execute the formula.


4

Find First Occurrence of a Value with the COUNTIF Function

This time, we will find whether the value in the cell is shown for the first time in the whole column. We cannot ask for a specific value, we will just look for repetitions.

➤ Take a whole different column for help. Make sure the rows are the same.
➤ Write this formula in the first cell after the heading:

fx
=COUNTIF($A$2:$A2,$A2)=1


➤ Autofill other cells

Explanation
The COUNTIF function looks whether the value of $A2 cell has occurred for the first time in the range $A$2:$A2. Then, as we autofill other cells, the range gets updated with $A$2:$A3, $A$2:$A4, and so on. The value is TRUE if it is the first occurrence, FALSE if it’s not.

5

Find and Replace Tool to Get the First Occurrence

It is possible to find the desired value even without using a formula. We are going to use excel’s find and replace function to do that.

➤ From the Home tab, find the Editing
➤ Go to Find & Select > Find…
➤ From the new dialog box, write the value you are seeking in the “Find what” box, and press Find Next.
➤ Excel will find the first occurrence of the value for you.


Downloadable Resources


Get our practice workbook or necessary files that we have worked with to prepare this article.

Find First Occurrence of a Value in a Column.xlsx

Practice Workbook · Excel (.xlsx)

Download File

Frequently Asked Questions

How do I find the first date in an Excel column?


Dates are stored as numbers in excel. Therefore, you can use a number-related function like MIN to find the lowest number, which will be the first date. Write the formula like this:
=MIN(A:A)
The formula will check column A and return the lowest number, which you can format as date.

How do I find most common occurrence in Excel?


Just like statistics, you can use the MODE function to do so. The formula should be written like the following:
=MODE(A1:A10)
Replace A1:A10 with your data range.

How do you check occurrence in Excel column?


You can use the COUNTIF function to check occurrences. Use the following format for the formula:
=COUNTIF(A:A,”Value”)
This formula checks for the Value occurrence in the A:A column.

How do you find the first occurrence of a value in an array in Excel?


Use the XLOOKUP function to look up the value.
=XLOOKUP(102, A2:A5, B2:B5)
Here, the first parameter (102) is the value, and the second one (A2:A5) is the array of cells to look for, and the third one (B2:B5) is the array from which to return the value. It will return the first value from the array.

How do I format the first date in Excel?


Select the cells and press Ctrl + 1. From the new dialog window, you can select the desired number format, which would be the date in this case.


Wrapping Up


In this article, we have learned five ways to find first occurrence of a value in a column in excel. The practice file is available for download, so check that out. Don’t forget to comment below on what you want to see us cover next time.

Free Weekly Tips

Liked this? Get one practical Excel tip every week.

🔒 100% Free · No spam ever · Unsubscribe anytime with 1-click

Comments

No comments yet — be the first to ask a question.

Comments are moderated before they appear. Your email is never shown.