Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 23
Default Row Number of VLOOKUP result

I am wanting to know the row number in which a VLOOKUP result was found. I
know I could have a column containing the row number, and return that as my
result, but that could lead to a good bit of other editing if I add such a
column to an already fairly well developed spreadsheet; I would just like to
avoid that option if I can.

Please offer help in either function calls and/or VBA macro - I am
comfortable with either or.

I would cross post in Programming too, but Daniel has told us that this
frowned on, and I don't know the USENET designation anyway - I wonder why
they even offer the option, when it is so difficult to find the necessary
information to do so, eh.

Best regards

Philip Hunt
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Row Number of VLOOKUP result

Hi,

Use MATCH

=MATCH(C1,A1:A10,0)

Where C1 contains your lookup value. Note this returns the position in the
range so if your range was a2 - A10 you would have to add 1 to the result to
get the correct row.

Mike

"Philip Mark Hunt" wrote:

I am wanting to know the row number in which a VLOOKUP result was found. I
know I could have a column containing the row number, and return that as my
result, but that could lead to a good bit of other editing if I add such a
column to an already fairly well developed spreadsheet; I would just like to
avoid that option if I can.

Please offer help in either function calls and/or VBA macro - I am
comfortable with either or.

I would cross post in Programming too, but Daniel has told us that this
frowned on, and I don't know the USENET designation anyway - I wonder why
they even offer the option, when it is so difficult to find the necessary
information to do so, eh.

Best regards

Philip Hunt

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,231
Default Row Number of VLOOKUP result

Mike H wrote...
Use MATCH

=MATCH(C1,A1:A10,0)

....

Generalizing, if the OP's VLOOKUP call were of the form

=VLOOKUP(v,t,c)

the row number of the match would be given by

=MATCH(v,INDEX(t,0,1))+MIN(ROW(t))+1

and if the OP's VLOOKUP call were of the form

=VLOOKUP(v,t,c,0)

the row number of the match would be given by

=MATCH(v,INDEX(t,0,1),0)+MIN(ROW(t))+1

These formulas work no matter in which cell the VLOOKUP table t begins.
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
#n/a result for vlookup adimar Excel Worksheet Functions 5 March 28th 08 08:58 PM
Vlookup in vlookup - taking the result as array name SupperDuck Excel Worksheet Functions 2 June 2nd 07 11:05 AM
vlookup shows result one cell above the expected result Marie Excel Worksheet Functions 7 November 14th 06 02:52 AM
VLOOKUP - Can't see result plunk25 Excel Worksheet Functions 1 June 29th 06 04:58 PM
vlookup based on random result returns incorrect result rickat Excel Worksheet Functions 1 December 6th 05 01:16 PM


All times are GMT +1. The time now is 08:51 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"