Hope I present this problem in an understandable way...
1.) DATA
I have an "up counting", table like this, which restarts the count from 1 "randomly":
[TABLE="class: grid, width: 100, align: left"]
<tbody>[TR]
[TD]Count[/TD]
[/TR]
[TR]
[TD]2[/TD]
[/TR]
[TR]
[TD]3[/TD]
[/TR]
[TR]
[TD]1[/TD]
[/TR]
[TR]
[TD]2[/TD]
[/TR]
[TR]
[TD]3[/TD]
[/TR]
[TR]
[TD]4[/TD]
[/TR]
[TR]
[TD]1[/TD]
[/TR]
[TR]
[TD]2[/TD]
[/TR]
[TR]
[TD]3[/TD]
[/TR]
[TR]
[TD]1[/TD]
[/TR]
[TR]
[TD]2[/TD]
[/TR]
[TR]
[TD]1[/TD]
[/TR]
[TR]
[TD]2[/TD]
[/TR]
[TR]
[TD]3[/TD]
[/TR]
[TR]
[TD]4[/TD]
[/TR]
</tbody>[/TABLE]
2.) GOAL
3.) APPROACH (working part)
If the column is "U", then I get an array with the row numbers of the values before the next "1" with:
={IF($U:$U=1,ROW($U:$U)-1,FALSE)}
4.) TEST
I tested it and it works, since i can access individual values with the small function.
={INDEX($U:$U,SMALL(IF($U:$U=1,ROW($U:$U)-1,FALSE),2))}
5.) APPROACH (not working part)
However, in order to get the minimum of the "all" values, i tried:
={MIN(INDEX($U:$U,IF($U:$U=1,ROW($U:$U)-1,FALSE)))}
which does not work. It returns "1".
6.) GUESS
I guess it is wrong since INDEX does not return an array, but a single value.
7.) QUESTION
Maybe I am on a wrong track, or I am missing something, but I can not solve this one.
Any help / hints / ideas welcome.
Thank you!
1.) DATA
I have an "up counting", table like this, which restarts the count from 1 "randomly":
[TABLE="class: grid, width: 100, align: left"]
<tbody>[TR]
[TD]Count[/TD]
[/TR]
[TR]
[TD]2[/TD]
[/TR]
[TR]
[TD]3[/TD]
[/TR]
[TR]
[TD]1[/TD]
[/TR]
[TR]
[TD]2[/TD]
[/TR]
[TR]
[TD]3[/TD]
[/TR]
[TR]
[TD]4[/TD]
[/TR]
[TR]
[TD]1[/TD]
[/TR]
[TR]
[TD]2[/TD]
[/TR]
[TR]
[TD]3[/TD]
[/TR]
[TR]
[TD]1[/TD]
[/TR]
[TR]
[TD]2[/TD]
[/TR]
[TR]
[TD]1[/TD]
[/TR]
[TR]
[TD]2[/TD]
[/TR]
[TR]
[TD]3[/TD]
[/TR]
[TR]
[TD]4[/TD]
[/TR]
</tbody>[/TABLE]
2.) GOAL
- It is easy to find the maximum: 4
- and I do not need the minimum value of the table [=1]
- but I need the minimum value of the count, just before it starts again with 1, which in this case is 2.
3.) APPROACH (working part)
If the column is "U", then I get an array with the row numbers of the values before the next "1" with:
={IF($U:$U=1,ROW($U:$U)-1,FALSE)}
4.) TEST
I tested it and it works, since i can access individual values with the small function.
={INDEX($U:$U,SMALL(IF($U:$U=1,ROW($U:$U)-1,FALSE),2))}
5.) APPROACH (not working part)
However, in order to get the minimum of the "all" values, i tried:
={MIN(INDEX($U:$U,IF($U:$U=1,ROW($U:$U)-1,FALSE)))}
which does not work. It returns "1".
6.) GUESS
I guess it is wrong since INDEX does not return an array, but a single value.
7.) QUESTION
Maybe I am on a wrong track, or I am missing something, but I can not solve this one.
Any help / hints / ideas welcome.
Thank you!