[Solved] Maintain historically largest cell value

Discuss the spreadsheet application
Locked
thebigo
Posts: 1
Joined: Wed Jul 10, 2024 7:58 pm

[Solved] Maintain historically largest cell value

Post by thebigo »

So, I've got a currency value in one cell, let's call it cell A1. This value can and does change from day to day. I want to save the historically greatest value in that cell in another cell, let's call this "historic value" cell B1. So anytime that A1 changes, it will look at the current value in B1, and if A1 > B1, then set B1 = A1, else B1 value stays unchanged. I've tried things for B1 like =if(A1>B1;A1;B1) which gives Err 522 (self reference error I believe). Seems like there is always going to be this self reference to B1, at least in any approach I can think of. But there has to be a way to do this seemingly simple compare and assign operation, yes? Any thoughts on approach would greatly appreciated, thanks in advance. :)
Last edited by MrProgrammer on Mon Jul 22, 2024 6:44 pm, edited 1 time in total.
Reason: Tagged ✓ [Solved], no further questions from thebigo -- MrProgrammer, forum moderator
OpenOffice 4.1.14 on Windows 11
User avatar
MrProgrammer
Moderator
Posts: 5430
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: Maintaining the historically largest value of a cell, in another cell

Post by MrProgrammer »

thebigo wrote: Wed Jul 10, 2024 8:30 pm I want to save the historically greatest value in that cell in another cell …
Search the Calc forum for the word accumulator. You will find topics where people want to show the sum of values entered in a cell. Your goal is similar: you want the maximum instead of the sum. Those topics might give you some ideas.

If this solved your problem please go to your first post use the Edit button and add [Solved] to the start of the Subject field. Select the green checkmark icon at the same time.

[Tutorial] Ten concepts that every Calc user should know
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.7.8, iMac Intel.   The locale for any menus or Calc formulas in my posts is English (USA).
Mountaineer
Posts: 336
Joined: Sun Sep 06, 2020 8:27 am

Re: Maintaining the historically largest value of a cell, in another cell

Post by Mountaineer »

MrProgrammer wrote: Wed Jul 10, 2024 9:27 pm...Your goal is similar: you want the maximum instead of the sum. ...
If he had a column of data, I'd say you are right, but as he seems to wish overwriting A1 always, there is no function to access deleted values.

For his/her approach he would need to have a macro, wich creates a persistent copy.

My idea would usually be to have two full columns with values and the date where the value was entered. Then the task is quite easy...

PS @MrProgramner: You asked a question via PM, but it is not possible to send you an answer. (My original signature was actually suggested by this website, as "it" was not satisfied with my version).
LibreOffice 7.6 on Windows 10pro and other Versions parallel
Locked