ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Calculate difference between cells with possible gap (https://www.excelbanter.com/excel-discussion-misc-queries/231860-calculate-difference-between-cells-possible-gap.html)

Espen Rostad[_2_]

Calculate difference between cells with possible gap
 
I have a WS monitoring use of water on a daily basis. In column A i have the
dates for a whole year, in column B I put in the amount of liters passed the
measuring device and in column C i have a formula that gives the amount of
water used since last reading. (Simply latest value - previous value)

My problem occurs when there comes a day when the counter has not been
checked and there is no input value. I Want to ceep all dates in Column A

How can I solve this?



Mike H

Calculate difference between cells with possible gap
 
Post you column C formula

"Espen Rostad" wrote:

I have a WS monitoring use of water on a daily basis. In column A i have the
dates for a whole year, in column B I put in the amount of liters passed the
measuring device and in column C i have a formula that gives the amount of
water used since last reading. (Simply latest value - previous value)

My problem occurs when there comes a day when the counter has not been
checked and there is no input value. I Want to ceep all dates in Column A

How can I solve this?



Espen Rostad[_2_]

Calculate difference between cells with possible gap
 
=MAKSA(B8-B7;0)

MAKSA could be MAX in english version. This is to avoid getting the negative
results in cell below last registered (in column C). I need to avoid this
becaus I have summarys for week and month.

Mike H skrev:


Mike H

Calculate difference between cells with possible gap
 
Hi,

Try this suitably altered to meet your regional syntax

=MAX(B2-LARGE($B$1:B2,2),0)

basically because the numbers (meter reading) should be in ascending order
you can find the second largest number which should be the previous reading
and use that.

Mike

"Espen Rostad" wrote:

=MAKSA(B8-B7;0)

MAKSA could be MAX in english version. This is to avoid getting the negative
results in cell below last registered (in column C). I need to avoid this
becaus I have summarys for week and month.

Mike H skrev:


Espen Rostad[_2_]

Calculate difference between cells with possible gap
 
If you could be so kind to explain what the different elements of that
formula refers to I might be able ti alter it to work for me. I have some
diffuculties getting the formula to work

Mike H skrev:


Mike H

Calculate difference between cells with possible gap
 
Hi,

I have envisaged your data looking like this

col A Col B Col C
01/01/2009 123
02/01/2009 456 333
03/01/2009 789 333
04/01/2009 0
05/01/2009 999 210

My formula goes in C2 and is dragged down and will return results like above.

=MAX(B2-LARGE($B$1:B2,2),0)


Mike

"Espen Rostad" wrote:

If you could be so kind to explain what the different elements of that
formula refers to I might be able ti alter it to work for me. I have some
diffuculties getting the formula to work

Mike H skrev:



All times are GMT +1. The time now is 01:33 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com