Download sheet and pictures from here: https://drive.google.com/folderview?id=0Bwf1Dk2NSstbQjZ6MVFsVzdGenM&usp=sharing or from here: https://onedrive.live.com/redir?resid=4571DC9D7435B2B0!148&authkey=!AO6MJtBNLRSSlPo&ithint=folder%2cjpg Sort values ​​in cells not recalculate see 4.2.4.2; 4.2.5.2 The error makes me LibreOffice version 4.2.4.2 and version 4.2.5.2; I also tried in different PC with different operating systems and still give the same error. In OpenOffice version 4.1 works correctly and does not give any error in the calculations. So it makes me think that is a problem in LibreOffice. Below I explain the operation I give this sheet. The leaf is from column A to V and from row 1 to 500. In the range A3: G500 is for income or modified data. In the range A3: A500 Discount each customer the M or F is entered or left blank according to the case. In the range B3: B500 Seller each customer is entered or left blank according to the case. In the range C3: C500 the voucher number is entered. In the range D3: D500 the date the voucher is entered. In the range E3: E500 Client Name is entered. In the range F3: F500 the amount of the voucher is entered without discount. In the range G3: G500 P if you enter voucher or payment total amount if partial payment or is left blank if not paid. In the range H3: V500 is where the calculations are performed and the results are shown. In the range M2: O2 totals and subtotals are displayed according to the search. The sheet has 3 macros that run with the 3 located between F1 and L1. Macro Print print what is displayed according to the print range C1: O500. Macro Sort sorts the range A3: G500 per Customer (alphabetical order) and then by date (ascending). Expired Macro commands the range A3: G500 by Date (Ascending). The range A3: K500 Automatic Filter is applied to filter as needed for consultation. The range A3: O500 has applied Conditional formatting. All cells are protected except the range A3: G500 that are on the entry or modification of data. In image 01 the total shown in M2 (MUST yellow, Total 311,610.79). The problem I have with this paper is that when entering new data for example in row 240 the image sum and 02 is calculated correctly (MUST BE 02 Total 311,710.79 image); but then applying the SORT macro recalculates and displays a different value (TO 03 Total 310,627.30 image); also shows me another value by applying macro UP (TO 04 Total 311,561.83 image). Applying again the macro SORT shows me another full (MUST image 05 Total 310,627.30); also at the end of the entries in row 236 from column H onwards does not recalculate the data and are shown as empty. For the tests I've done the problem is presented to sort data, the error also occurs when sorting manually from the menu Data> Sort; so that tells me that's not a problem of MACROS.