Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Searching UPWARDS for a value?

Could anyone suggest worksheet functions that will allow me to search
UP a column for a given value, starting from a given position in the
column.

The vlookup function always searches down and so always returns the
first match rather than the last. I want to do this without having to
sort the data first.

Thanks

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 299
Default Searching UPWARDS for a value?

If you want the last occurrence of a lookup value if there are more than one
and you want to return a value from the same row so if the match is A12 and
you want B12 to be returned?

=INDEX(B2:B20,MAX((A2:A20=D1)*(ROW(A2:A20)))-1)

entered with ctrl + shift & enter

the -1 is to offset the number of cells for row 1, in this case the values
start in row2, if they started in row3 it would be -2 at the end, or change
the index range to always start from the first row (B1:B20) in this case

--


Regards,

Peo Sjoblom

Excel 95 - Excel 2007
Northwest Excel Solutions
www.nwexcelsolutions.com
(remove ^^ from email)


wrote in message
oups.com...
Could anyone suggest worksheet functions that will allow me to search
UP a column for a given value, starting from a given position in the
column.

The vlookup function always searches down and so always returns the
first match rather than the last. I want to do this without having to
sort the data first.

Thanks



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 18
Default Searching UPWARDS for a value?

Why do you want to search upward? If you include the "FALSE" at the end of
your vlookup, it won't matter what manner your data is sorted in. But the
"False" statement means you will only get the "exact" matches...and not
approximations.

" wrote:

Could anyone suggest worksheet functions that will allow me to search
UP a column for a given value, starting from a given position in the
column.

The vlookup function always searches down and so always returns the
first match rather than the last. I want to do this without having to
sort the data first.

Thanks


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,688
Default Searching UPWARDS for a value?

Here's another one:

=LOOKUP(2,1/(A2:A20="X"),B2:B20)

Returns the value from column B that corresponds to the last instance of
"X".

Biff

"Peo Sjoblom" wrote in message
...
If you want the last occurrence of a lookup value if there are more than
one and you want to return a value from the same row so if the match is
A12 and you want B12 to be returned?

=INDEX(B2:B20,MAX((A2:A20=D1)*(ROW(A2:A20)))-1)

entered with ctrl + shift & enter

the -1 is to offset the number of cells for row 1, in this case the values
start in row2, if they started in row3 it would be -2 at the end, or
change the index range to always start from the first row (B1:B20) in this
case

--


Regards,

Peo Sjoblom

Excel 95 - Excel 2007
Northwest Excel Solutions
www.nwexcelsolutions.com
(remove ^^ from email)


wrote in message
oups.com...
Could anyone suggest worksheet functions that will allow me to search
UP a column for a given value, starting from a given position in the
column.

The vlookup function always searches down and so always returns the
first match rather than the last. I want to do this without having to
sort the data first.

Thanks





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
Want a serious muslim match?Join our club and start searching now!!! [email protected] Excel Discussion (Misc queries) 0 May 17th 06 07:47 AM
Want a serious muslim match?Join our club and start searching now!!! [email protected] Excel Worksheet Functions 0 May 17th 06 07:25 AM
Working with range of numbers in a cell and searching same Penny Excel Discussion (Misc queries) 0 May 3rd 06 04:52 PM
Working with range of numbers in a cell and searching same Penny Excel Worksheet Functions 0 May 3rd 06 04:12 PM
Searching for partial data in a column Severin Excel Discussion (Misc queries) 2 October 3rd 05 06:33 PM


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