Ask Your Question
0

Replace max value [closed]

asked 2013-02-08 04:56:24 +0200

gfc gravatar image

updated 2013-02-08 05:24:09 +0200

H \H*strong text How do I (for example) compare the numerical value of a1 to the numerical value of a2 and if a1 is greater than a2, replace a2 by a1? Every time I try to set up the IF formula, I get an error. I suppose this is recursive. So why can't I do recursive?

A1 changes periodically and can go up or down. I want to capture the max value of A1 in A2 whenever A1 exceeds A2.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2015-10-21 15:25:02.368132

Comments

A1 changes periodically and can go up or down. I want to capture the max value of A1 in A2 whenever A1 exceeds A2. This is a circular reference problem rather than a recursive problem.

gfc gravatar imagegfc ( 2013-02-08 05:25:29 +0200 )edit

4 Answers

Sort by » oldest newest most voted
0

answered 2013-02-08 11:00:44 +0200

m.a.riosv gravatar image

A formula like:
=MAX(A1:B1)
works as expected if you have set up Iterations in Calc options.

image description

edit flag offensive delete link more

Comments

Thanks, this works. gfc

gfc gravatar imagegfc ( 2013-02-09 23:58:54 +0200 )edit
1

answered 2013-02-08 09:00:14 +0200

ROSt52 gravatar image

updated 2013-02-09 11:17:40 +0200

qubit gravatar image

@gfc The comment you added to your quesiton:

A1 changes periodically and can go up or down. I want to capture the max value of A1 in A2 whenever A1 exceeds A2.

made me thinking and I can imagine 3 situations:

(As you compare a1 and a2, I assume you have your figures in row 1 and row 2)

  1. You want to compare the values in row 1 with a single value in row 2.
  2. You want to detect the maximum value of row 1 for each period during which the values increase, decreases, increases....
  3. You have a 2 rows of figures and you want to replace the values in row 2 with the values of row 1 whenever the the values in in cell of row 1 is greater than the value of the cell being just below of the figures, you want to replace the figure in row 2 with the figure of row 1.

If 1, then the answer by qubit is perfectly fine and in row 2 you will find the answer

If 2, the situation is a bit more complex and I would need to see you figures to get an idea what could be done.

If 3, you can apply the logic of qubit and have your formula in row 3

edit flag offensive delete link more
0

answered 2013-02-08 05:21:30 +0200

gfc gravatar image

A1 changes periodically and can go up or down. I want to capture the max value of A1 in A2 whenever A1 exceeds A2.

edit flag offensive delete link more

Comments

What is A2? A fixed value or the first maximum detected? This is still not clear to me.

ROSt52 gravatar imageROSt52 ( 2013-02-12 04:56:47 +0200 )edit
0

answered 2013-02-08 05:01:42 +0200

qubit gravatar image

This isn't a recursive problem.

  1. If A1 <= A2, then nothing changes. Things only get interesting when A1 is strictly greater than A2.

  2. If A1 > A2, then you set A2 = A1. At this point, A1 == A2, so you're back to case #1.

Could you provide an example of a situation in which you'd want to set up a spreadsheet this way?

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-02-08 04:56:24 +0200

Seen: 102 times

Last updated: Feb 09 '13