Reputation: 100
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'
Upvotes: 0
Views: 1227
Reputation: 75950
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)
Upvotes: 0
Reputation: 152605
If one has FILTERXML:
=MIN(FILTERXML("<a><b>"&SUBSTITUTE(A1,",","</b><b>")&"</b></a>","//b"))
For the MAX, just replace the MIN with MAX.
Upvotes: 1
Reputation: 54883
You can try this:
=MIN(0+MID(SUBSTITUTE(A1, ",", REPT(" ",255)), 255*(ROW(INDIRECT("1:"&(1+LEN(A1)-LEN(SUBSTITUTE(A1,",","")))))-1)+1,255))
Upvotes: 1