Excel Worksheet Function Help - Subtract first item from last item in grouping

Hi Experts,

I have a spreadsheet that has grouped repeating numbers in column B.  There are times associated with those numbers.  I need the last number in the group minus the first number in the group to be in column M on the last row in that grouping.

Sounds confusing, but I've attached a spreadsheet to make it easier.  I know that I can do this with VBA but I would much rather use a formula.


LVL 10
Who is Participating?
barry houdiniConnect With a Mentor Commented:
Hello Jeremy, try this formula in M2 copied down


see attached

regards, barry
Chris Raisin(Retired Analyst/Programmer)Commented:
What version of Excel are you using?
FamousMortimerAuthor Commented:
Forgot to mention... 2010
FamousMortimerAuthor Commented:
Very nice, thanks a lot
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.