Link to home
Start Free TrialLog in
Avatar of djmurpyataagroupdotcom
djmurpyataagroupdotcom

asked on

Calculate difference from previous non-blank cell

I need a formula to calculate the difference in cells from the previous non-blank cell.  The data is formatted with dates in column A, readings (both blank and non-blank) in column B, and the difference from the previous reading in Column C.  See attached for an example.

Date            Reading	Diff
1/1/2010	54.4	0.0
1/2/2010	54.4	0.0
1/3/2010	54.4	0.0
1/4/2010	54.4	0.0
1/5/2010		
1/6/2010		
1/7/2010	54.4	0.0
1/8/2010	55.5	1.1
1/9/2010	55.5	0.0
1/10/2010	55.5	0.0
1/11/2010	56.5	1.0
1/12/2010		
1/13/2010		
1/14/2010	56.7	0.0
1/15/2010	56.7	0.0
1/16/2010	56.7	0.0
1/17/2010	56.9	0.2
1/18/2010	56.9	0.0
1/19/2010		
1/20/2010	56.9	0.0
1/21/2010	56.9	0.0
1/22/2010	56.9	0.0
1/23/2010	56.9	0.0

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of barry houdini
barry houdini
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Put this in C3 and drag down:

=IF(ISERROR(B3-B2),"",B3-B2)

There's no difference for C2, since it's the start, so just set that to 0

Book1.xls
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of djmurpyataagroupdotcom
djmurpyataagroupdotcom

ASKER

Thanks to both you!!  Ended up using barryhoudini's.