Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 131
Default Find Highest Date in a range

Hello

Criteria dates;
(Sheet 1) A1 = 01/01/2009, A2 = 31/01/2009
(Sheet 2) A1 to A27 list of dates 01/01/2009 to 27/01/2009

I need a formula that will find cell with the highest date in the range
between the criteria dates, and the return the value of the adjacent cell
(Sheet 2) Col B.

Thank you.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Find Highest Date in a range

Hi,

Try this ARRAY formula which would go on Sheet1

=VLOOKUP(MAX(IF(Sheet2!A1:A27=A1,IF(Sheet2!A1:A27 <=A2,Sheet2!A1:A27))),Sheet2!A1:B27,2,FALSE)

This is an array formula which must be entered by pressing CTRL+Shift+Enter
'and not just Enter. If you do it correctly then Excel will put curly brackets
'around the formula {}. You can't type these yourself. If you edit the formula
'you must enter it again with CTRL+Shift+Enter.

--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"LaDdIe" wrote:

Hello

Criteria dates;
(Sheet 1) A1 = 01/01/2009, A2 = 31/01/2009
(Sheet 2) A1 to A27 list of dates 01/01/2009 to 27/01/2009

I need a formula that will find cell with the highest date in the range
between the criteria dates, and the return the value of the adjacent cell
(Sheet 2) Col B.

Thank you.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 131
Default Find Highest Date in a range

Thanks Mike, it works a treat!
{=VLOOKUP(MAX(IF(DataSheetDate=AI8,IF(DataSheetDa te<=A8,DataSheetDate))),DataSheet!A8:AI2957,4,FALS E)}

If the value being looked up is nothing can the results be returned as
nothing,
in this example the looked up value is a date and the destination cell is
formated as a date and so where the looked up value is nothing it returns
00/01/1900.

Thank you

"Mike H" wrote:

Hi,

Try this ARRAY formula which would go on Sheet1

=VLOOKUP(MAX(IF(Sheet2!A1:A27=A1,IF(Sheet2!A1:A27 <=A2,Sheet2!A1:A27))),Sheet2!A1:B27,2,FALSE)

This is an array formula which must be entered by pressing CTRL+Shift+Enter
'and not just Enter. If you do it correctly then Excel will put curly brackets
'around the formula {}. You can't type these yourself. If you edit the formula
'you must enter it again with CTRL+Shift+Enter.

--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"LaDdIe" wrote:

Hello

Criteria dates;
(Sheet 1) A1 = 01/01/2009, A2 = 31/01/2009
(Sheet 2) A1 to A27 list of dates 01/01/2009 to 27/01/2009

I need a formula that will find cell with the highest date in the range
between the criteria dates, and the return the value of the adjacent cell
(Sheet 2) Col B.

Thank you.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Find Highest Date in a range

Hi,

Do you mean if the 'returned' value is zero? If so the formula gets a bit
long but you simply wrap it in an IF statement

=IF(VLOOKUP(MAX(IF(Sheet2!A1:A27=A1,IF(Sheet2!A1: A27<=A2,Sheet2!A1:A27))),Sheet2!A1:B27,2,FALSE)=0, "",VLOOKUP(MAX(IF(Sheet2!A1:A27=A1,IF(Sheet2!A1:A 27<=A2,Sheet2!A1:A27))),Sheet2!A1:B27,2,FALSE))

Still an ARRAY formula

--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"LaDdIe" wrote:

Thanks Mike, it works a treat!
{=VLOOKUP(MAX(IF(DataSheetDate=AI8,IF(DataSheetDa te<=A8,DataSheetDate))),DataSheet!A8:AI2957,4,FALS E)}

If the value being looked up is nothing can the results be returned as
nothing,
in this example the looked up value is a date and the destination cell is
formated as a date and so where the looked up value is nothing it returns
00/01/1900.

Thank you

"Mike H" wrote:

Hi,

Try this ARRAY formula which would go on Sheet1

=VLOOKUP(MAX(IF(Sheet2!A1:A27=A1,IF(Sheet2!A1:A27 <=A2,Sheet2!A1:A27))),Sheet2!A1:B27,2,FALSE)

This is an array formula which must be entered by pressing CTRL+Shift+Enter
'and not just Enter. If you do it correctly then Excel will put curly brackets
'around the formula {}. You can't type these yourself. If you edit the formula
'you must enter it again with CTRL+Shift+Enter.

--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"LaDdIe" wrote:

Hello

Criteria dates;
(Sheet 1) A1 = 01/01/2009, A2 = 31/01/2009
(Sheet 2) A1 to A27 list of dates 01/01/2009 to 27/01/2009

I need a formula that will find cell with the highest date in the range
between the criteria dates, and the return the value of the adjacent cell
(Sheet 2) Col B.

Thank you.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 131
Default Find Highest Date in a range

Once again Thank you correctly interpreting my question and providing a
solution

Best wishes

"Mike H" wrote:

Hi,

Do you mean if the 'returned' value is zero? If so the formula gets a bit
long but you simply wrap it in an IF statement

=IF(VLOOKUP(MAX(IF(Sheet2!A1:A27=A1,IF(Sheet2!A1: A27<=A2,Sheet2!A1:A27))),Sheet2!A1:B27,2,FALSE)=0, "",VLOOKUP(MAX(IF(Sheet2!A1:A27=A1,IF(Sheet2!A1:A 27<=A2,Sheet2!A1:A27))),Sheet2!A1:B27,2,FALSE))

Still an ARRAY formula

--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"LaDdIe" wrote:

Thanks Mike, it works a treat!
{=VLOOKUP(MAX(IF(DataSheetDate=AI8,IF(DataSheetDa te<=A8,DataSheetDate))),DataSheet!A8:AI2957,4,FALS E)}

If the value being looked up is nothing can the results be returned as
nothing,
in this example the looked up value is a date and the destination cell is
formated as a date and so where the looked up value is nothing it returns
00/01/1900.

Thank you

"Mike H" wrote:

Hi,

Try this ARRAY formula which would go on Sheet1

=VLOOKUP(MAX(IF(Sheet2!A1:A27=A1,IF(Sheet2!A1:A27 <=A2,Sheet2!A1:A27))),Sheet2!A1:B27,2,FALSE)

This is an array formula which must be entered by pressing CTRL+Shift+Enter
'and not just Enter. If you do it correctly then Excel will put curly brackets
'around the formula {}. You can't type these yourself. If you edit the formula
'you must enter it again with CTRL+Shift+Enter.

--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"LaDdIe" wrote:

Hello

Criteria dates;
(Sheet 1) A1 = 01/01/2009, A2 = 31/01/2009
(Sheet 2) A1 to A27 list of dates 01/01/2009 to 27/01/2009

I need a formula that will find cell with the highest date in the range
between the criteria dates, and the return the value of the adjacent cell
(Sheet 2) Col B.

Thank you.

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
Compare number to range; find highest positive difference RBW Excel Worksheet Functions 6 January 13th 09 01:58 PM
Find closest match and return next highest number in range x6v87qe Excel Discussion (Misc queries) 4 June 18th 08 01:58 PM
Rolling up the latest date, criteria of range to compare highest d JulieMK Excel Programming 0 April 10th 08 01:28 AM
Julian date - find next highest date/number jchick0909 Excel Worksheet Functions 1 March 20th 08 11:38 PM
Find date and copy range based on that date avzundert Excel Programming 2 November 25th 04 10:31 AM


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