Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
SubTotal function to return number of rows returns only zero | Excel Worksheet Functions | |||
Function to return a month name from a number (1-12) that is not a | Excel Worksheet Functions | |||
How do you return current ROW number to definition in NAME function? | Setting up and Configuration of Excel | |||
Is there a function that will return the page number? | Excel Worksheet Functions | |||
return the column reference number of a function result | Excel Discussion (Misc queries) |