Results 1 to 4 of 4

Thread: How to find first occurance of a number in Excel

  1. #1
    Join Date
    Jun 2009
    Posts
    3,859

    How to find first occurance of a number in Excel

    I have a worksheet which involves 1000's of records in it. In that worksheet I want to find the first occurrence of a data entry throughout the worksheet. But I don't know how to fetch this data entry. It is very tedious task to do that manually. Can you help me how to find first occurrence in Excel?

  2. #2
    Join Date
    Apr 2008
    Posts
    4,088

    Re: How to find first occurance of a number in Excel

    You can use VLOOKUP to find the first occurrence of a particular value in a worksheet or a database. In the next cell, put the function like "=VLOOKUP(data_value,cols,number_of_col,FALSE)". This function will find the "data_value" entry in "cols" column.

  3. #3
    Join Date
    May 2008
    Posts
    4,345

    Re: How to find first occurance of a number in Excel

    You can even use a VB code to find the first occurrence of the entries as follows:

    Code:
    	Function FindNthOccurrence(Table As Range, Val1 As Variant,Val1Occurrence As Integer, Val2 As Variant,Val2Col As Integer, ResultCol As Integer)
    
    	Dim i As Integer
    	Dim iCount As Integer
    	Dim rCol As Range
    
    		For i = 1 To Table.Rows.Count
    
    			If Table.Cells(i, 1) = Val1Occurrence And Table.Cells(i, Val2Col) = Val2 Then
    				iCount = iCount + 1
    			End If
    
    			If iCount = Val1Occurrence Then
    				FindNth = Table.Cells(i, ResultCol)
    				Exit For
    			End If
    
    		Next i
    
    End Function

  4. #4
    Join Date
    Apr 2008
    Posts
    2,139

    Re: How to find first occurance of a number in Excel

    Excel has an inbuilt function know as "MATCH" which finds the exact match of your value. This function returns the row number of the first occurrence of that value.

    Syntax: "=MATCH(lookup_value,lookup_array,match_type)"

    where
    lookup_value is the data entry that you want to find
    lookup_array is the range of column in which you want to find the data entry
    match_type is the boolean value whether the match was found or not

Similar Threads

  1. Java : test a number to find out if its is even or odd
    By teenQ in forum Software Development
    Replies: 4
    Last Post: 06-04-2012, 06:42 AM
  2. Find the number of text repeated in columns of Excel
    By Jigisha in forum MS Office Support
    Replies: 4
    Last Post: 24-02-2012, 04:35 PM
  3. How to find total number of duplicates from lists of sheet in excel
    By Kungfu Pandey in forum MS Office Support
    Replies: 2
    Last Post: 08-01-2012, 04:51 PM
  4. How to find Carrier Tracking Number?
    By Bardoczky in forum Portable Devices
    Replies: 5
    Last Post: 26-05-2010, 05:13 PM
  5. How to find serial number on Compaq pc
    By Sori in forum Hardware Peripherals
    Replies: 3
    Last Post: 30-07-2009, 10:51 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,507,626.26522 seconds with 17 queries