Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Nav Nav is offline
external usenet poster
 
Posts: 43
Default Lookup the last occurance of a value in a list

Hello

I am trying to find out if there is a way or work around to use vlookup in a
list where it finds the last occurance of an item and gives the corresponding
value in relation to it.
Eg.

Pear 5
Apple 5
Orange 3
Plum 2
Apple 1

I need it to look at the last occurance of Apple and return the value 1, but
the problem is the vlookup finds the first occurance only and returns 5.

Any ideas anyone.

Thank you in advance for any help.

Regards,
Nav
  #3   Report Post  
Posted to microsoft.public.excel.misc
Nav Nav is offline
external usenet poster
 
Posts: 43
Default Lookup the last occurance of a value in a list

Hi

Do you know if this work with text too, or just numbers, as some of the data
are text.

Thank you.



"Don Guillett" wrote:

One way. This is an ARRAY formula which must be entered using
Ctrl+shift+enter
=INDIRECT("c"&MAX(IF(B1:B10="apple",ROW(A1:A10))))

--
Don Guillett
SalesAid Software

"Nav" wrote in message
...
Hello

I am trying to find out if there is a way or work around to use vlookup in
a
list where it finds the last occurance of an item and gives the
corresponding
value in relation to it.
Eg.

Pear 5
Apple 5
Orange 3
Plum 2
Apple 1

I need it to look at the last occurance of Apple and return the value 1,
but
the problem is the vlookup finds the first occurance only and returns 5.

Any ideas anyone.

Thank you in advance for any help.

Regards,
Nav




  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default Lookup the last occurance of a value in a list

On Thu, 7 Sep 2006 07:07:01 -0700, Nav wrote:

Hello

I am trying to find out if there is a way or work around to use vlookup in a
list where it finds the last occurance of an item and gives the corresponding
value in relation to it.
Eg.

Pear 5
Apple 5
Orange 3
Plum 2
Apple 1

I need it to look at the last occurance of Apple and return the value 1, but
the problem is the vlookup finds the first occurance only and returns 5.

Any ideas anyone.

Thank you in advance for any help.

Regards,
Nav


You could use this **array** (entered with <ctrl<shift<enter ) formula:

=INDEX(B1:B10,MAX(ROW(A1:A10)*(A1:A10="Apple")))

With your fruit in A1:A10 and your values in B1:B5.


--ron
  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default Lookup the last occurance of a value in a list

This will work for either text or numbers in col B that you seek. It will
give the item in col C.
Perhaps you did not Array enter. You must use ctrl+shift+enter instead of
just enter.
=INDIRECT("c"&MAX(IF(B1:B11=1,ROW(A1:A11))))
--
Don Guillett
SalesAid Software

"Nav" wrote in message
...
I tried it for both, but it didn't seem to work for either, not sure if I
did
something wrong but I copied and pasted the below (with ctrl+shift+enter),
hence I was asking.

Thanks anyway.

"Don Guillett" wrote:

Did you try it?

--
Don Guillett
SalesAid Software

"Nav" wrote in message
...
Hi

Do you know if this work with text too, or just numbers, as some of the
data
are text.

Thank you.



"Don Guillett" wrote:

One way. This is an ARRAY formula which must be entered using
Ctrl+shift+enter
=INDIRECT("c"&MAX(IF(B1:B10="apple",ROW(A1:A10))))

--
Don Guillett
SalesAid Software

"Nav" wrote in message
...
Hello

I am trying to find out if there is a way or work around to use
vlookup
in
a
list where it finds the last occurance of an item and gives the
corresponding
value in relation to it.
Eg.

Pear 5
Apple 5
Orange 3
Plum 2
Apple 1

I need it to look at the last occurance of Apple and return the
value
1,
but
the problem is the vlookup finds the first occurance only and
returns
5.

Any ideas anyone.

Thank you in advance for any help.

Regards,
Nav








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
lookup a list of values for an array formula Xbrokylnboy Excel Worksheet Functions 0 June 19th 06 08:12 PM
Using Lookup on an expanding list Charles Excel Worksheet Functions 2 February 10th 06 01:31 PM
How to lookup the dates of a list that are only the first of the . Snaggle22 Excel Worksheet Functions 3 April 12th 05 10:39 PM
Lookup closest number in list Jeff Excel Discussion (Misc queries) 6 November 26th 04 07:27 PM
double lookup, nest, or macro? Josef.angel Excel Worksheet Functions 1 October 29th 04 09:50 AM


All times are GMT +1. The time now is 06:03 AM.

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"