Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Pirjo
 
Posts: n/a
Default return cell reference from any column

Hello

I am searching for a function to return the cell reference for a lookup
value that can be found in any row and any column in the table.
Say the table has 10 columns and 250 rows and I am looking for a value that
I write in a specified cell. I would like Excel to write the cell reference
to know where in the table I find this value.

I have found a function =CELL("address";INDEX(A:A;MATCH(K1;A:A;0)))
but this can be used in only one column. Now I have several columns and
changing this area to multicolumn returns #n/a (or #ref) because I believe
Match does not understand but one column.

can you, please, help me?
Pirjo

  #2   Report Post  
bj
 
Posts: n/a
Default

one way to do this is to use a user defined function

a very brute force one I have used is

Function advl(val)
advl = Cells.Find(What:=val, After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False , SearchFormat:=False).Address
End Function

if the value can be outside the table, you will have to expand the function
to goto find again when the address isn't suitable.

"Pirjo" wrote:

Hello

I am searching for a function to return the cell reference for a lookup
value that can be found in any row and any column in the table.
Say the table has 10 columns and 250 rows and I am looking for a value that
I write in a specified cell. I would like Excel to write the cell reference
to know where in the table I find this value.

I have found a function =CELL("address";INDEX(A:A;MATCH(K1;A:A;0)))
but this can be used in only one column. Now I have several columns and
changing this area to multicolumn returns #n/a (or #ref) because I believe
Match does not understand but one column.

can you, please, help me?
Pirjo

  #3   Report Post  
Pirjo
 
Posts: n/a
Default

Hi

Thanks a lot! this works like charm :)

"bj" wrote:

one way to do this is to use a user defined function

a very brute force one I have used is

Function advl(val)
advl = Cells.Find(What:=val, After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False , SearchFormat:=False).Address
End Function

if the value can be outside the table, you will have to expand the function
to goto find again when the address isn't suitable.

"Pirjo" wrote:

Hello

I am searching for a function to return the cell reference for a lookup
value that can be found in any row and any column in the table.
Say the table has 10 columns and 250 rows and I am looking for a value that
I write in a specified cell. I would like Excel to write the cell reference
to know where in the table I find this value.

I have found a function =CELL("address";INDEX(A:A;MATCH(K1;A:A;0)))
but this can be used in only one column. Now I have several columns and
changing this area to multicolumn returns #n/a (or #ref) because I believe
Match does not understand but one column.

can you, please, help me?
Pirjo

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
Return cell reference of lookup value bobm Excel Worksheet Functions 3 July 7th 05 08:49 AM
Format cell in column B based on value in the next cell (column c) Nicole Excel Discussion (Misc queries) 7 May 18th 05 10:19 PM
up to 7 functions? ALex Excel Worksheet Functions 10 April 12th 05 06:42 PM
Syntax for inferred cell references donesquire Excel Worksheet Functions 4 April 4th 05 09:29 PM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 07:16 PM


All times are GMT +1. The time now is 03:20 PM.

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

About Us

"It's about Microsoft Excel"