Finding Min and Max out of a concatenated string containing multiple values

pawan

New Member
Joined
Dec 25, 2009
Messages
44
Office Version
  1. 365
Platform
  1. Windows
I have another related problem to the Min and Max problem in a concatenated string solved in the thread below.


Here, there is no comma separation but problem is same i.e. of extracting max and min values out of a concatenated data string. The data is below.

DataExpected MinimumExpected Maximum
061031000000000000000000DDDDDDDDDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD031061
XXXXXXDDDXXXXXX000000XXX
0​
0​
XXXDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDXXXDDDXXXDDDXXXXXXDDDXXXXXXXXXXXX
0​
0​
000000000000000000000000000000000000000000000000000054023000000000000000000000000000000000000DDDDDD000000023054


Each data point in the column "Data" is itself a concatenated string of several data points, each having a character length of 3 characters. These could be a 3 digit number or there could be "000" data point which means "no data". Similarly "DDD" or "XXX" also refer to no data being available. What is needed is a max and min of data points available.

So in the first row, 061 is the first data point, 031 is the second data point and so on. In the first row only two data points are available and 061 is maximum and 031 is minimum.

In the second and third row, there are no data points; so min and max both are Zeros "0"

In the last row 054 and 023 are the two data points and the max and min are obviously 054 and 023 respectively

There are 40K + rows in my data table and any formula using Indirect(1:xxx) which fills numbers 1 to xxx in a cell will put "hang" my file. Hence to be avoided.

Please help. Thanks in advance.
 
Don't use Ctrl Shift Enter, it should just be Enter & it will spill across
Oh. OK. Now I got it. Can it be made to return only minimum or maximum at a time? Not too confident of handling spilled arrays
 
Upvote 0

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Ok, how about
+Fluff 1.xlsm
ABC
1DataExpected MinimumExpected Maximum
2061031000000000000000000DDDDDDDDDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD061031
3XXXXXXDDDXXXXXX000000XXX00
4XXXDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDXXXDDDXXXDDDXXXXXXDDDXXXXXXXXXXXX00
5000000000000000000000000000000000000000000000000000054023000000000000000000000000000000000000DDDDDD000000054023
Main
Cell Formulas
RangeFormula
B2:B5B2=LET(m,MID(A2,SEQUENCE(,LEN(A2)/3,,3),3),INDEX(SORT(FILTER(m,(ISNUMBER(m+1))*(m<>"000"),"0"),,-1,1),1))
C2:C5C2=LET(m,MID(A2,SEQUENCE(,LEN(A2)/3,,3),3),INDEX(SORT(FILTER(m,(ISNUMBER(m+1))*(m<>"000"),"0"),,1,1),1))
 
Upvote 0
Solution
As an alternative:
Excel Formula:
=IFERROR(AGGREGATE({15,14},6,1/(1/MID(A2,SEQUENZ(QUOTIENT(LEN(A2),3),,,3),3)),1),0)
 
Upvote 0
Ok, how about
+Fluff 1.xlsm
ABC
1DataExpected MinimumExpected Maximum
2061031000000000000000000DDDDDDDDDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD061031
3XXXXXXDDDXXXXXX000000XXX00
4XXXDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDXXXDDDXXXDDDXXXXXXDDDXXXXXXXXXXXX00
5000000000000000000000000000000000000000000000000000054023000000000000000000000000000000000000DDDDDD000000054023
Main
Cell Formulas
RangeFormula
B2:B5B2=LET(m,MID(A2,SEQUENCE(,LEN(A2)/3,,3),3),INDEX(SORT(FILTER(m,(ISNUMBER(m+1))*(m<>"000"),"0"),,-1,1),1))
C2:C5C2=LET(m,MID(A2,SEQUENCE(,LEN(A2)/3,,3),3),INDEX(SORT(FILTER(m,(ISNUMBER(m+1))*(m<>"000"),"0"),,1,1),1))
Works like a charm. Thank you!!
 
Upvote 0
Glad to help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,948
Messages
6,122,420
Members
449,083
Latest member
Ava19

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top