Find a number in a String between 2 numbers

Hi Guys,

Can you please help me with the following Search in LIbre Calc.
I tried every option that I could think of but couldn’t get it to work.

The problem goes like this (just and example)
I have 2 predefined numbers:
B3=5
B4=10

And I have a sting of sorted (from smaller to higher) numbers, like this:
1,2,7,11,15,20

I am looking for a function to Search and give me a number from the string between the two predefined values.
Note: There is only one number that matches the criterion to be between the 2 numbers.
In this example it should give me 7

I tried using something like this:
IF(AND(D$19:D$29>B3,D$19:D$29<B4),1,0)

But I always get: N/A, Err. or something similar.

Glad if anyone can give me some pointers :slight_smile:
Thanks, Nikola

Data>Text to columns … can split the string into 6 cell values.
Then =LOOKUP(B4;$A$1:$F$1) returns 7.

1 Like

Alternative - kilometer length formula. :slight_smile: