That's because the original sample data only reflected the first requirement.If you change the sample data (just the way I did in my second post), you automatically get your solution as per second requirement too.