0
votes

I found this formula which I can get the max value form a cell containing comma separated numbers. How can I get the min value using a similar approach?

=MATCH(1000,INDEX(FIND(","&ROW(INDIRECT("1:999"))&",",","&D2&","),0))

Cell content '1,2,3,4,5,6,7,8,9,10,11,12,13,14,15'

3

3 Answers

1
votes

You can try this:

=MIN(0+MID(SUBSTITUTE(A1, ",", REPT(" ",255)), 255*(ROW(INDIRECT("1:"&(1+LEN(A1)-LEN(SUBSTITUTE(A1,",","")))))-1)+1,255))
1
votes

If one has FILTERXML:

=MIN(FILTERXML("<a><b>"&SUBSTITUTE(A1,",","</b><b>")&"</b></a>","//b"))

For the MAX, just replace the MIN with MAX.

0
votes

I'd also go with FILTERXML. But if your string always follows this pattern it seems like the smallest number is always found on the left before the first comma which you could make perfect use of!

=--LEFT(A1,FIND(",",A1&",")-1)