Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Embedded vlookup question

I have a vlookup that isn't working because it would pull back multiple
rows. How do I tell the vlookup to pull back the row with the most
recent date?

Example of existing query:

=VLOOKUP($A$22,'Tgt Inv'!$B:$F,4,FALSE)

Will pull back following rows since they all have 302 as the delimiter.


NA 302 2/14/2006 340 670 4.6
NA 302 1/18/2006 304 670 4
NA 302 12/18/2005 340 670 4.3
NA 302 1/26/2004 340 670 4

How do I embedd something in it to pull the row with the latest date--
or in this example-- the one with the 2/14/06 date?

Help?

Thanks!
knox5731

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Embedded vlookup question

Vlookup will only pull back the value for the row with the first matching
value for the lookup column. So in the example you show, that would be the
correct result.

As long as your data is sorted by descending date, it should work.

--
Regards,
Tom Ogilvy


" wrote:

I have a vlookup that isn't working because it would pull back multiple
rows. How do I tell the vlookup to pull back the row with the most
recent date?

Example of existing query:

=VLOOKUP($A$22,'Tgt Inv'!$B:$F,4,FALSE)

Will pull back following rows since they all have 302 as the delimiter.


NA 302 2/14/2006 340 670 4.6
NA 302 1/18/2006 304 670 4
NA 302 12/18/2005 340 670 4.3
NA 302 1/26/2004 340 670 4

How do I embedd something in it to pull the row with the latest date--
or in this example-- the one with the 2/14/06 date?

Help?

Thanks!
knox5731


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Embedded vlookup question

Nope that didn't work...it still comes back with 'NA', I'm not sure
what is going on.......and sometimes it pulls the row above its data.


Tom Ogilvy wrote:
Vlookup will only pull back the value for the row with the first matching
value for the lookup column. So in the example you show, that would be the
correct result.

As long as your data is sorted by descending date, it should work.

--
Regards,
Tom Ogilvy


" wrote:

I have a vlookup that isn't working because it would pull back multiple
rows. How do I tell the vlookup to pull back the row with the most
recent date?

Example of existing query:

=VLOOKUP($A$22,'Tgt Inv'!$B:$F,4,FALSE)

Will pull back following rows since they all have 302 as the delimiter.


NA 302 2/14/2006 340 670 4.6
NA 302 1/18/2006 304 670 4
NA 302 12/18/2005 340 670 4.3
NA 302 1/26/2004 340 670 4

How do I embedd something in it to pull the row with the latest date--
or in this example-- the one with the 2/14/06 date?

Help?

Thanks!
knox5731



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
VLOOKUP function with embedded LEFT SamB Excel Worksheet Functions 7 October 7th 09 06:16 PM
Symbols showing up as question (?) in embedded excel table in word df_newtovba[_2_] Excel Discussion (Misc queries) 0 March 23rd 09 09:46 PM
Embedded vlookup? PeteJ Excel Worksheet Functions 1 March 12th 08 04:38 PM
Embedded excel sheet in outlook question??? Shane Excel Discussion (Misc queries) 2 February 6th 06 04:33 PM
question about scrollbars and embedded charts Brian Murphy[_2_] Excel Programming 7 October 12th 04 01:26 AM


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