Solved

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

Posted on 2011-03-16
4
312 Views
Last Modified: 2012-08-13
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.

Test.xlsm

Thanks
-Jeremy
0
Comment
Question by:FamousMortimer
  • 2
4 Comments
 
LVL 13

Expert Comment

by:Chris Raisin
ID: 35147376
What version of Excel are you using?
0
 
LVL 10

Author Comment

by:FamousMortimer
ID: 35147782
Forgot to mention... 2010
0
 
LVL 50

Accepted Solution

by:
barry houdini earned 500 total points
ID: 35147933
Hello Jeremy, try this formula in M2 copied down

=IF(B2<>B3,L2-LOOKUP(2,1/(B$1:B1<>B2),L$2:L2),"")

see attached

regards, barry
26890495.xlsm
0
 
LVL 10

Author Closing Comment

by:FamousMortimer
ID: 35147994
Very nice, thanks a lot
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
My experience with Windows 10 over a one year period and suggestions for smooth operation
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question