A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

LOOKUP VALUE OCCURS ONCE IN TABLE ARRAY - RETURN LAST OCCURRENCE



 
 
Thread Tools Display Modes
  #1  
Old January 15th, 2010, 07:33 PM posted to microsoft.public.excel.worksheet.functions
robzrob
external usenet poster
 
Posts: 114
Default LOOKUP VALUE OCCURS ONCE IN TABLE ARRAY - RETURN LAST OCCURRENCE

Hello All

Writing this workbook in 2007, but it will be used in 2003. Have
searched but can't find answer to this. I have a 5-column (A to E)
table array and I'm using VLOOKUP in several other cells to return
values in col2, 3, 4 & 5 with my lookup value being col 1. However,
col 1 will contain numbers which occur more than once. How can I get
VLOOKUP (or something else?) to pick the last occurence (lowest row)
and use that one? Also, the array will be sorted - smallest to
largest - as the rows go down - how will the SORT work on duplicate
entries? I'd like, if possible, for the entry made most recently to
be the lowest of the duplicate entries so that VLOOKUP (or whatever)
will pick that one to use. Will any kind of SORT do that?
  #2  
Old January 15th, 2010, 08:55 PM posted to microsoft.public.excel.worksheet.functions
ryguy7272
external usenet poster
 
Posts: 1,593
Default LOOKUP VALUE OCCURS ONCE IN TABLE ARRAY - RETURN LAST OCCURRENCE

This should do it for you:
=INDEX($B$1:$B$10,MATCH(MAX(IF($A$1:$A$10="A",ROW( $A$1:$A$10))),IF($A$1:$A$10="A",ROW($A$1:$A$10)),0 ))

Enter with Ctrl + Shift + Enter, not just Enter.

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"robzrob" wrote:

Hello All

Writing this workbook in 2007, but it will be used in 2003. Have
searched but can't find answer to this. I have a 5-column (A to E)
table array and I'm using VLOOKUP in several other cells to return
values in col2, 3, 4 & 5 with my lookup value being col 1. However,
col 1 will contain numbers which occur more than once. How can I get
VLOOKUP (or something else?) to pick the last occurence (lowest row)
and use that one? Also, the array will be sorted - smallest to
largest - as the rows go down - how will the SORT work on duplicate
entries? I'd like, if possible, for the entry made most recently to
be the lowest of the duplicate entries so that VLOOKUP (or whatever)
will pick that one to use. Will any kind of SORT do that?
.

  #3  
Old January 15th, 2010, 09:09 PM posted to microsoft.public.excel.worksheet.functions
T. Valko
external usenet poster
 
Posts: 15,759
Default LOOKUP VALUE OCCURS ONCE IN TABLE ARRAY - RETURN LAST OCCURRENCE

See if this is what you had in mind...

X...1
Y...5
Z...2
X...4

To lookup the *last* instance of X:

=LOOKUP(2,1/(A1:A4="x"),B1:B4)

Result = 4

--
Biff
Microsoft Excel MVP


"robzrob" wrote in message
...
Hello All

Writing this workbook in 2007, but it will be used in 2003. Have
searched but can't find answer to this. I have a 5-column (A to E)
table array and I'm using VLOOKUP in several other cells to return
values in col2, 3, 4 & 5 with my lookup value being col 1. However,
col 1 will contain numbers which occur more than once. How can I get
VLOOKUP (or something else?) to pick the last occurence (lowest row)
and use that one? Also, the array will be sorted - smallest to
largest - as the rows go down - how will the SORT work on duplicate
entries? I'd like, if possible, for the entry made most recently to
be the lowest of the duplicate entries so that VLOOKUP (or whatever)
will pick that one to use. Will any kind of SORT do that?



  #4  
Old January 15th, 2010, 11:30 PM posted to microsoft.public.excel.worksheet.functions
robzrob
external usenet poster
 
Posts: 114
Default LOOKUP VALUE OCCURS ONCE IN TABLE ARRAY - RETURN LAST OCCURRENCE

On Jan 15, 8:55*pm, ryguy7272
wrote:
This should do it for you:
=INDEX($B$1:$B$10,MATCH(MAX(IF($A$1:$A$10="A",ROW( $A$1:$A$10))),IF($A$1:$A$*10="A",ROW($A$1:$A$10)), 0))

Enter with Ctrl + Shift + Enter, not just Enter.

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''..



"robzrob" wrote:
Hello All


Writing this workbook in 2007, but it will be used in 2003. *Have
searched but can't find answer to this. *I have a 5-column (A to E)
table array and I'm using VLOOKUP in several other cells to return
values in col2, 3, 4 & 5 with my lookup value being col 1. *However,
col 1 will contain numbers which occur more than once. *How can I get
VLOOKUP (or something else?) to pick the last occurence (lowest row)
and use that one? *Also, the array will be sorted - smallest to
largest - as the rows go down - how will the SORT work on duplicate
entries? *I'd like, if possible, for the entry made most recently to
be the lowest of the duplicate entries so that VLOOKUP (or whatever)
will pick that one to use. *Will any kind of SORT do that?
.- Hide quoted text -


- Show quoted text -


Thanks - have got another formula now which works. (Can't see any
'Yes' (or no) to click - sorry
  #5  
Old January 15th, 2010, 11:31 PM posted to microsoft.public.excel.worksheet.functions
robzrob
external usenet poster
 
Posts: 114
Default LOOKUP VALUE OCCURS ONCE IN TABLE ARRAY - RETURN LAST OCCURRENCE

On Jan 15, 8:55*pm, ryguy7272
wrote:
This should do it for you:
=INDEX($B$1:$B$10,MATCH(MAX(IF($A$1:$A$10="A",ROW( $A$1:$A$10))),IF($A$1:$A$*10="A",ROW($A$1:$A$10)), 0))

Enter with Ctrl + Shift + Enter, not just Enter.

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''..



"robzrob" wrote:
Hello All


Writing this workbook in 2007, but it will be used in 2003. *Have
searched but can't find answer to this. *I have a 5-column (A to E)
table array and I'm using VLOOKUP in several other cells to return
values in col2, 3, 4 & 5 with my lookup value being col 1. *However,
col 1 will contain numbers which occur more than once. *How can I get
VLOOKUP (or something else?) to pick the last occurence (lowest row)
and use that one? *Also, the array will be sorted - smallest to
largest - as the rows go down - how will the SORT work on duplicate
entries? *I'd like, if possible, for the entry made most recently to
be the lowest of the duplicate entries so that VLOOKUP (or whatever)
will pick that one to use. *Will any kind of SORT do that?
.- Hide quoted text -


- Show quoted text -


Thanks - have got another formula now which works. (Can't see any
'Yes' (or no) to click - sorry
  #6  
Old January 15th, 2010, 11:32 PM posted to microsoft.public.excel.worksheet.functions
robzrob
external usenet poster
 
Posts: 114
Default LOOKUP VALUE OCCURS ONCE IN TABLE ARRAY - RETURN LAST OCCURRENCE

On Jan 15, 9:09*pm, "T. Valko" wrote:
See if this is what you had in mind...

X...1
Y...5
Z...2
X...4

To lookup the *last* instance of X:

=LOOKUP(2,1/(A1:A4="x"),B1:B4)

Result = 4

--
Biff
Microsoft Excel MVP

"robzrob" wrote in message

...



Hello All


Writing this workbook in 2007, but it will be used in 2003. *Have
searched but can't find answer to this. *I have a 5-column (A to E)
table array and I'm using VLOOKUP in several other cells to return
values in col2, 3, 4 & 5 with my lookup value being col 1. *However,
col 1 will contain numbers which occur more than once. *How can I get
VLOOKUP (or something else?) to pick the last occurence (lowest row)
and use that one? *Also, the array will be sorted - smallest to
largest - as the rows go down - how will the SORT work on duplicate
entries? *I'd like, if possible, for the entry made most recently to
be the lowest of the duplicate entries so that VLOOKUP (or whatever)
will pick that one to use. *Will any kind of SORT do that?- Hide quoted text -


- Show quoted text -


Thanks - have got another formula now which works.
  #7  
Old February 13th, 2010, 08:30 AM posted to microsoft.public.excel.worksheet.functions
[email protected]
external usenet poster
 
Posts: 1
Default LOOKUP VALUE OCCURS ONCE IN TABLE ARRAY - RETURN LAST OCCURRE

Rob,
Please post the answer instead of posting cryptic messages. This will help
other users.

Cheers
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


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


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