Ask Your Question
0

Calculate difference between two cells - Part 2

asked 2017-08-29 20:37:28 +0200

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

I'm doing a mileage spreadsheet for my car,

In cell A1 heading = Mileage
in cell A2 value = 50000
In cell A3 value = 50100
In cell A4 value = 50200
..and so on

Difference amount goes into Cell B2

So in this case B2 = 200 (A4-A2)

Without knowing how many entries will be introduced in column A (could be 10 or could be 110 entries) How can I ask calc to calculate the difference between the last entry in Column A and the first Entry in Column A (A2)

So Basically I just want to subtract the first entry from the last current entry In Column A with out out knowing how many entries there might be using an array formula.

Thanks again for the help

edit retag flag offensive close merge delete

Comments

I can't see that your post is a wiki. Sorry.

Please name the cells like A1; A2 and so on; it's a convention

Grantler gravatar imageGrantler ( 2017-08-29 22:29:49 +0200 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2017-08-29 22:13:56 +0200

Grantler gravatar image

updated 2017-09-02 08:58:24 +0200

So you need the MAXimum of column A. Alter the formula this way:

Write in B2 the following formula: =MAX(A:A)-A2

Tested on LO 5.4.0.3 - be aware that =MAX(A:A) does not work in some previous versions or Apache OpenOffice.

Cheers

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2017-08-29 20:37:28 +0200

Seen: 596 times

Last updated: Sep 02 '17