natetheblade2
New Member
- Joined
- Apr 20, 2016
- Messages
- 4
I am having a problem coming up with a MAX function that will return the last date in a sequence.
I have tried the =MAX(IF($A$n:$A$n=An,$B$n:$B$n)) function, although it returns the MAX date in the entire list rather than just the highest number date for the given unique ID number.
For example, here is what I would like:[TABLE="width: 500"]
<tbody>[TR]
[TD]ID#[/TD]
[TD]Year[/TD]
[TD]MAX Year[/TD]
[/TR]
[TR]
[TD]12345[/TD]
[TD]2011[/TD]
[TD]2012[/TD]
[/TR]
[TR]
[TD]12345[/TD]
[TD]2012[/TD]
[TD]2012[/TD]
[/TR]
[TR]
[TD]23456[/TD]
[TD]2016[/TD]
[TD]2016[/TD]
[/TR]
[TR]
[TD]34567[/TD]
[TD]2010[/TD]
[TD]2012[/TD]
[/TR]
[TR]
[TD]34567[/TD]
[TD]2012[/TD]
[TD]2012[/TD]
[/TR]
[TR]
[TD]45678[/TD]
[TD]2013[/TD]
[TD]2013[/TD]
[/TR]
[TR]
[TD]56789[/TD]
[TD]2014[/TD]
[TD]2014[/TD]
[/TR]
</tbody>[/TABLE]
What I get with the previous formula is 2016 for the MAX Year, rather than 2012 for those ID#'s that repeat.
Any idea of how to make Max Year return that max year for the ID number?
I have tried the =MAX(IF($A$n:$A$n=An,$B$n:$B$n)) function, although it returns the MAX date in the entire list rather than just the highest number date for the given unique ID number.
For example, here is what I would like:[TABLE="width: 500"]
<tbody>[TR]
[TD]ID#[/TD]
[TD]Year[/TD]
[TD]MAX Year[/TD]
[/TR]
[TR]
[TD]12345[/TD]
[TD]2011[/TD]
[TD]2012[/TD]
[/TR]
[TR]
[TD]12345[/TD]
[TD]2012[/TD]
[TD]2012[/TD]
[/TR]
[TR]
[TD]23456[/TD]
[TD]2016[/TD]
[TD]2016[/TD]
[/TR]
[TR]
[TD]34567[/TD]
[TD]2010[/TD]
[TD]2012[/TD]
[/TR]
[TR]
[TD]34567[/TD]
[TD]2012[/TD]
[TD]2012[/TD]
[/TR]
[TR]
[TD]45678[/TD]
[TD]2013[/TD]
[TD]2013[/TD]
[/TR]
[TR]
[TD]56789[/TD]
[TD]2014[/TD]
[TD]2014[/TD]
[/TR]
</tbody>[/TABLE]
What I get with the previous formula is 2016 for the MAX Year, rather than 2012 for those ID#'s that repeat.
Any idea of how to make Max Year return that max year for the ID number?