Number formula needed

I need a formula and can’t figure it out right now, except I will try a for loop if no one can think of a better way.

I have a list of three numbers (x), and a single number (y).

x:=5:10:15;

y:=7;

What formula would return 10 because 7 is greater than 5 but less than or equal to 10?

Thanks for any help you might provide.

Subject: Number formula needed

try this:

list1:= 5:10:15;

list2 := 7;

TMP := @Sort(@Text(LIST1:LIST2));

place := @Member(@Text(list2); tmp);

theNumber := @Subset(@Subset(tmp; place+1); -1);

Subject: RE: Number formula needed

This seems to always return the value in list2 (e.g. 7). I’m eager to get this to work though because my @while version is long and ugly.

I’m also interested in seeing if how the sorting works with relative to @text (if list1 contains 1,10,11,12,100).

Subject: RE: Number formula needed

Sorry about that (I should have tested first).

Try this:

list1:= 5:10:15;

list2 := 7;

TMP := @Sort(LIST1:LIST2);

place := @Member(@Text(list2); @Text(tmp));

theNumber := @Subset(@Subset(tmp; place+1); -1);

Subject: Thanks!

Works like a charm, and much neater than my solution.