Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 20
Default vlookup function that returns the greates/oldest of many to one

Column A is a list of user names that repeat many times. Column B is a list
dates corresponding to the names that repeat in column A. Column D is a list
of Active user names that do not repeat.

I need to look up the Active user name in Column D from Column A in order to
return the greatest/most recent date from column B.

Example of existing data:
User Name Date Active User Name
JohnDoe 03/20/09 JohnDoe
JohnDoe 02/20/09 JaneDoe
JohnDoe 01/20/09 MargeLoe
JohnDoe 12/20/08 DonRoe
JohnDoe 11/20/09 PhilWoe

Example of search results:
User Name Date Active User Name
JohnDoe 03/20/09 JohnDoe

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default vlookup function that returns the greates/oldest of many to one

It appears that you want the max date that is less than or equal to today's
date otherwise the greatest/most recent date for JohnDoe is 11/20/2009.

Try this array formula** :

=MAX(IF((A2:A6=C2)*(B2:B6<=TODAY()),B2:B6))

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT
key then hit ENTER.

Format as Date

--
Biff
Microsoft Excel MVP


"confused!!" wrote in message
...
Column A is a list of user names that repeat many times. Column B is a
list
dates corresponding to the names that repeat in column A. Column D is a
list
of Active user names that do not repeat.

I need to look up the Active user name in Column D from Column A in order
to
return the greatest/most recent date from column B.

Example of existing data:
User Name Date Active User Name
JohnDoe 03/20/09 JohnDoe
JohnDoe 02/20/09 JaneDoe
JohnDoe 01/20/09 MargeLoe
JohnDoe 12/20/08 DonRoe
JohnDoe 11/20/09 PhilWoe

Example of search results:
User Name Date Active User Name
JohnDoe 03/20/09 JohnDoe



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 20
Default vlookup function that returns the greates/oldest of many to on

Great!!!!! it works!!!!

HOWEVER i tred to copy paste function on row 3 the formula didn't search
back to row 2 for information.

In order to search on row 2 i had to edit the formula and change all the 3s
to 2s.

Edit/paste special doesn't work. Any suggestions?

"T. Valko" wrote:

It appears that you want the max date that is less than or equal to today's
date otherwise the greatest/most recent date for JohnDoe is 11/20/2009.

Try this array formula** :

=MAX(IF((A2:A6=C2)*(B2:B6<=TODAY()),B2:B6))

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT
key then hit ENTER.

Format as Date

--
Biff
Microsoft Excel MVP


"confused!!" wrote in message
...
Column A is a list of user names that repeat many times. Column B is a
list
dates corresponding to the names that repeat in column A. Column D is a
list
of Active user names that do not repeat.

I need to look up the Active user name in Column D from Column A in order
to
return the greatest/most recent date from column B.

Example of existing data:
User Name Date Active User Name
JohnDoe 03/20/09 JohnDoe
JohnDoe 02/20/09 JaneDoe
JohnDoe 01/20/09 MargeLoe
JohnDoe 12/20/08 DonRoe
JohnDoe 11/20/09 PhilWoe

Example of search results:
User Name Date Active User Name
JohnDoe 03/20/09 JohnDoe




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default vlookup function that returns the greates/oldest of many to on

Make the row references absolute:

=MAX(IF((A$2:A$6=C2)*(B$2:B$6<=TODAY()),B$2:B$6))

Then you can just drag copy down the column.

--
Biff
Microsoft Excel MVP


"confused!!" wrote in message
...
Great!!!!! it works!!!!

HOWEVER i tred to copy paste function on row 3 the formula didn't search
back to row 2 for information.

In order to search on row 2 i had to edit the formula and change all the
3s
to 2s.

Edit/paste special doesn't work. Any suggestions?

"T. Valko" wrote:

It appears that you want the max date that is less than or equal to
today's
date otherwise the greatest/most recent date for JohnDoe is 11/20/2009.

Try this array formula** :

=MAX(IF((A2:A6=C2)*(B2:B6<=TODAY()),B2:B6))

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the
SHIFT
key then hit ENTER.

Format as Date

--
Biff
Microsoft Excel MVP


"confused!!" wrote in message
...
Column A is a list of user names that repeat many times. Column B is a
list
dates corresponding to the names that repeat in column A. Column D is a
list
of Active user names that do not repeat.

I need to look up the Active user name in Column D from Column A in
order
to
return the greatest/most recent date from column B.

Example of existing data:
User Name Date Active User Name
JohnDoe 03/20/09 JohnDoe
JohnDoe 02/20/09 JaneDoe
JohnDoe 01/20/09 MargeLoe
JohnDoe 12/20/08 DonRoe
JohnDoe 11/20/09 PhilWoe

Example of search results:
User Name Date Active User Name
JohnDoe 03/20/09 JohnDoe






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 returns duplicate values Bigbelt Excel Discussion (Misc queries) 5 December 18th 08 02:27 AM
vlookup returns #n/a Michael Dieckmann Excel Worksheet Functions 2 July 2nd 08 08:56 AM
VLOOKUP returns #REF!? Cam Excel Discussion (Misc queries) 1 April 15th 08 05:34 AM
How do I write a VLOOKUP function that returns 0's, not neg vals? dbsavoy Excel Worksheet Functions 4 August 24th 06 05:26 PM
VLOOKUP Returns #REF Michael Excel Worksheet Functions 3 September 19th 05 01:54 PM


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