Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 109
Default Function that can return the row number

Can someone help....I need to know if there is a function in excel that can
look through a column of data, find a specific cost center and return the
first instance/row that costcenter shows and also the last instance/row

Thanks
--
Helping Is always a good thing
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default Function that can return the row number

The MATCH function will return the relative position of a cell within
a range which matches another cell, eg:

=MATCH(sought_value,range,0)

where range can be a full-column reference, eg D:D, and sought_value
can be a specific value or a reference to a cell which contains that
value (your cost centre). If your range is, for example, D10:D24, then
you will have to add 9 onto the result to get the actual row number of
the matched item.

Hope this helps.

Pete

On Aug 14, 12:15*am, QuietMan
wrote:
Can someone help....I need to know if there is a function in excel that can
look through a column of data, find a specific cost center and return the
first instance/row that costcenter shows and also the last instance/row

Thanks
--
Helping Is always a good thing


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 108
Default Function that can return the row number

If, as I understand it, you're looking for the number of the row on which a
certain value appears, you want MATCH. For example, if you have a list of
cost centers, like this:

A
101355
102183
502721
500003
313099


....and so on, and you want to discover that 502721 first appears on row 4,
then =MATCH(502721,A1:A999,FALSE) will return the value 4.

(I think it's FALSE; maybe it's 0. You'd better look it up.)

Now, that gets you the first occurrence of the desired string. How to get
the last occurrence...hmm.

--- "QuietMan" wrote:
Can someone help....I need to know if there is a function in excel that can
look through a column of data, find a specific cost center and return the
first instance/row that costcenter shows and also the last instance/row

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 109
Default Function that can return the row number

Thanks, but dosen't help me find the last instance...any ideas on that
--
Helping Is always a good thing


"Pete_UK" wrote:

The MATCH function will return the relative position of a cell within
a range which matches another cell, eg:

=MATCH(sought_value,range,0)

where range can be a full-column reference, eg D:D, and sought_value
can be a specific value or a reference to a cell which contains that
value (your cost centre). If your range is, for example, D10:D24, then
you will have to add 9 onto the result to get the actual row number of
the matched item.

Hope this helps.

Pete

On Aug 14, 12:15 am, QuietMan
wrote:
Can someone help....I need to know if there is a function in excel that can
look through a column of data, find a specific cost center and return the
first instance/row that costcenter shows and also the last instance/row

Thanks
--
Helping Is always a good thing



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,268
Default Function that can return the row number

This will give you the row number counted starting with row 1

=MAX(IF(A1:A2000=C1,ROW(A1:A2000)))

where C1 holds the costcenter name/number/string


It needs to be entered with ctrl + shift & enter


=CELL("address",INDEX(A1:A2000,MAX(IF(A1:A2000=C1, ROW(A1:A2000)))))

also entered the same way


will give you the absolute cell reference

--


Regards,


Peo Sjoblom



"QuietMan" wrote in message
...
Thanks, but dosen't help me find the last instance...any ideas on that
--
Helping Is always a good thing


"Pete_UK" wrote:

The MATCH function will return the relative position of a cell within
a range which matches another cell, eg:

=MATCH(sought_value,range,0)

where range can be a full-column reference, eg D:D, and sought_value
can be a specific value or a reference to a cell which contains that
value (your cost centre). If your range is, for example, D10:D24, then
you will have to add 9 onto the result to get the actual row number of
the matched item.

Hope this helps.

Pete

On Aug 14, 12:15 am, QuietMan
wrote:
Can someone help....I need to know if there is a function in excel that
can
look through a column of data, find a specific cost center and return
the
first instance/row that costcenter shows and also the last instance/row

Thanks
--
Helping Is always a good thing







  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 109
Default Function that can return the row number

Thanks you very much....would have had to write vba to do this.....
--
Helping Is always a good thing


"Peo Sjoblom" wrote:

This will give you the row number counted starting with row 1

=MAX(IF(A1:A2000=C1,ROW(A1:A2000)))

where C1 holds the costcenter name/number/string


It needs to be entered with ctrl + shift & enter


=CELL("address",INDEX(A1:A2000,MAX(IF(A1:A2000=C1, ROW(A1:A2000)))))

also entered the same way


will give you the absolute cell reference

--


Regards,


Peo Sjoblom



"QuietMan" wrote in message
...
Thanks, but dosen't help me find the last instance...any ideas on that
--
Helping Is always a good thing


"Pete_UK" wrote:

The MATCH function will return the relative position of a cell within
a range which matches another cell, eg:

=MATCH(sought_value,range,0)

where range can be a full-column reference, eg D:D, and sought_value
can be a specific value or a reference to a cell which contains that
value (your cost centre). If your range is, for example, D10:D24, then
you will have to add 9 onto the result to get the actual row number of
the matched item.

Hope this helps.

Pete

On Aug 14, 12:15 am, QuietMan
wrote:
Can someone help....I need to know if there is a function in excel that
can
look through a column of data, find a specific cost center and return
the
first instance/row that costcenter shows and also the last instance/row

Thanks
--
Helping Is always a good thing





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
SubTotal function to return number of rows returns only zero DZ Excel Worksheet Functions 6 May 3rd 23 05:06 PM
Function to return a month name from a number (1-12) that is not a Chuck M Excel Worksheet Functions 7 July 27th 07 08:35 PM
How do you return current ROW number to definition in NAME function? Franz Verga Setting up and Configuration of Excel 1 July 24th 06 04:13 PM
Is there a function that will return the page number? garyme2 Excel Worksheet Functions 1 July 15th 05 12:15 AM
return the column reference number of a function result Mahendhra Excel Discussion (Misc queries) 2 May 16th 05 12:46 PM


All times are GMT +1. The time now is 11:34 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"