Hi all
This is my craziest formula and one of the craziest I've seen. The equivalent vba is just a couple of statements!
The formula extracts digits out of a string. Only works in xl2007 as some functions are deeply nested. Uses an auxilliary formula or else it would be unmanageable.
Extracts up to 30 digits.
I'm sure there must be a simpler solution (like, for ex., any other solution) but it was fun to build.
<table border="1" cellpadding="1" style="background:#FFF; border-collapse:collapse;border-width:2px;border-color:#CCCCCC;font-family:Arial,Arial; font-size:10pt" ><tr><th style="border-width:1px;border-color:#888888;background:#9CF " > </th><th style="border-width:1px;border-color:#888888;background:#9CF; text-align:center" >A</th><th style="border-width:1px;border-color:#888888;background:#9CF; text-align:center" width=30 >B</th><th style="border-width:1px;border-color:#888888;background:#9CF; text-align:center" >C</th><th style="border-width:1px;border-color:#888888;background:#9CF; text-align:center" width=30 >D</th><th style="border-width:1px;border-color:#888888;background:#9CF; text-align:center" width=30 >E</th></tr><tr><td style="border-width:1px;border-color:#000000; padding-left:0.5em; padding-top:0.4em; padding-right:0.5em; padding-bottom:0.25em;background:#9CF; text-align:center; " ><b>1</b></td><td style="border-width:1px;border-color:#000000; padding-left:0.5em; padding-top:0.4em; padding-right:0.5em; padding-bottom:0.25em;text-align:left;border-width: 1px;border-color:#888888; ">0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610</td><td style="border-width:1px;border-color:#000000; padding-left:0.5em; padding-top:0.4em; padding-right:0.5em; padding-bottom:0.25em;text-align:right;border-width: 1px;border-color:#888888; "> </td><td style="border-width:1px;border-color:#000000; padding-left:0.5em; padding-top:0.4em; padding-right:0.5em; padding-bottom:0.25em;text-align:left;border-width: 1px;border-color:#888888; ">01123581321345589144233377610</td><td style="border-width:1px;border-color:#000000; padding-left:0.5em; padding-top:0.4em; padding-right:0.5em; padding-bottom:0.25em;text-align:right;border-width: 1px;border-color:#888888; "> </td><td style="border-width:1px;border-color:#000000; padding-left:0.5em; padding-top:0.4em; padding-right:0.5em; padding-bottom:0.25em;text-align:right;border-width: 1px;border-color:#888888; ">35</td></tr><tr><td style="border-width:1px;border-color:#000000; padding-left:0.5em; padding-top:0.4em; padding-right:0.5em; padding-bottom:0.25em;background:#9CF; text-align:center; " ><b>2</b></td><td style="border-width:1px;border-color:#000000; padding-left:0.5em; padding-top:0.4em; padding-right:0.5em; padding-bottom:0.25em;text-align:left;border-width: 1px;border-color:#888888; ">0 Mary 123-456 had a 7890 987.654 little 321 lamb 0</td><td style="border-width:1px;border-color:#000000; padding-left:0.5em; padding-top:0.4em; padding-right:0.5em; padding-bottom:0.25em;text-align:right;border-width: 1px;border-color:#888888; "> </td><td style="border-width:1px;border-color:#000000; padding-left:0.5em; padding-top:0.4em; padding-right:0.5em; padding-bottom:0.25em;text-align:left;border-width: 1px;border-color:#888888; ">012345678909876543210</td><td style="border-width:1px;border-color:#000000; padding-left:0.5em; padding-top:0.4em; padding-right:0.5em; padding-bottom:0.25em;text-align:right;border-width: 1px;border-color:#888888; "> </td><td style="border-width:1px;border-color:#000000; padding-left:0.5em; padding-top:0.4em; padding-right:0.5em; padding-bottom:0.25em;text-align:right;border-width: 1px;border-color:#888888; ">31</td></tr><tr><td colspan=6 style="background:#9CF; padding-left:1em" > [ExtractDigits.xlsb]Sol xl2007</td></tr></table><br>
<br>
<table border="1" cellpadding="1" style="background:#FFF; border-collapse:collapse;border-width:2px;border-color:#CCCCCC;font-family:Arial,Arial; font-size:10pt" ><tr><td style="border-width:1px;border-color:#000000; padding-left:0.5em; padding-top:0.4em; padding-right:0.5em; padding-bottom:0.25em;background:#9CF; " >Addr</td><td style="border-width:1px;border-color:#000000; padding-left:0.5em; padding-top:0.4em; padding-right:0.5em; padding-bottom:0.25em;background:#9CF; " >Formula</td></tr><tr><td colspan=2 style="border-width:1px;border-color:#000000; padding-left:0.5em; padding-top:0.4em; padding-right:0.5em; padding-bottom:0.25em;background:#9CF; " >[ExtractDigits.xlsb]Sol xl2007</td></tr><tr><td rowspan=2 style="border-width:1px;border-color:#000000; padding-left:0.5em; padding-top:0.4em; padding-right:0.5em; padding-bottom:0.25em;text-align:center; " >C1</td><td style="border-width:1px;border-color:#000000; padding-left:0.5em; padding-top:0.4em; padding-right:0.5em; padding-bottom:0.25em; " > =TEXT<span style="font-weight: 600;color: blue;">(</span>SUM<span style="font-weight: 600;color: maroon;">(</span>IF<span style="font-weight: 600;color: black;">(</span>ISNUMBER<span style="font-weight: 600;color: red;">(</span>-MID<span style="font-weight: 600;color: green;">(</span>A1,ROW<span style="font-weight: 600;color: fuchsia;">(</span>INDIRECT<span style="font-weight: 600;color: teal;">(</span>"1:"&E1<span style="font-weight: 600;color: teal;">)</span><span style="font-weight: 600;color: fuchsia;">)</span>,1<span style="font-weight: 600;color: green;">)</span><span style="font-weight: 600;color: red;">)</span>,MID<span style="font-weight: 600;color: red;">(</span>A1,ROW<span style="font-weight: 600;color: green;">(</span>INDIRECT<span style="font-weight: 600;color: fuchsia;">(</span>"1:"&E1<span style="font-weight: 600;color: fuchsia;">)</span><span style="font-weight: 600;color: green;">)</span>,1<span style="font-weight: 600;color: red;">)</span>*10^<span style="font-weight: 600;color: red;">(</span>10*E1-SUMPRODUCT<span style="font-weight: 600;color: green;">(</span>LEN<span style="font-weight: 600;color: fuchsia;">(</span>SUBSTITUTE<span style="font-weight: 600;color: teal;">(</span>LEFT<span style="font-weight: 600;color: olive;">(</span>A1,E1<span style="font-weight: 600;color: olive;">)</span>,ROW<span style="font-weight: 600;color: olive;">(</span>INDIRECT<span style="font-weight: 600;color: blue;">(</span>"1:10"<span style="font-weight: 600;color: blue;">)</span><span style="font-weight: 600;color: olive;">)</span>-1,""<span style="font-weight: 600;color: teal;">)</span><span style="font-weight: 600;color: fuchsia;">)</span><span style="font-weight: 600;color: green;">)</span>-10*ROW<span style="font-weight: 600;color: green;">(</span>INDIRECT<span style="font-weight: 600;color: fuchsia;">(</span>"1:"&E1<span style="font-weight: 600;color: fuchsia;">)</span><span style="font-weight: 600;color: green;">)</span>+MMULT<span style="font-weight: 600;color: green;">(</span>LEN<span style="font-weight: 600;color: fuchsia;">(</span>SUBSTITUTE<span style="font-weight: 600;color: teal;">(</span>LEFT<span style="font-weight: 600;color: olive;">(</span>A1,ROW<span style="font-weight: 600;color: blue;">(</span>INDIRECT<span style="font-weight: 600;color: maroon;">(</span>"1:"&E1<span style="font-weight: 600;color: maroon;">)</span><span style="font-weight: 600;color: blue;">)</span><span style="font-weight: 600;color: olive;">)</span>,TRANSPOSE<span style="font-weight: 600;color: olive;">(</span>ROW<span style="font-weight: 600;color: blue;">(</span>INDIRECT<span style="font-weight: 600;color: maroon;">(</span>"1:10"<span style="font-weight: 600;color: maroon;">)</span><span style="font-weight: 600;color: blue;">)</span>-1<span style="font-weight: 600;color: olive;">)</span>,""<span style="font-weight: 600;color: teal;">)</span><span style="font-weight: 600;color: fuchsia;">)</span>,--<span style="font-weight: 600;color: fuchsia;">(</span>ROW<span style="font-weight: 600;color: teal;">(</span>INDIRECT<span style="font-weight: 600;color: olive;">(</span>"1:10"<span style="font-weight: 600;color: olive;">)</span><span style="font-weight: 600;color: teal;">)</span>>0<span style="font-weight: 600;color: fuchsia;">)</span><span style="font-weight: 600;color: green;">)</span><span style="font-weight: 600;color: red;">)</span><span style="font-weight: 600;color: black;">)</span><span style="font-weight: 600;color: maroon;">)</span>,REPT<span style="font-weight: 600;color: maroon;">(</span>"0",10*E1-SUMPRODUCT<span style="font-weight: 600;color: black;">(</span>LEN<span style="font-weight: 600;color: red;">(</span>SUBSTITUTE<span style="font-weight: 600;color: green;">(</span>LEFT<span style="font-weight: 600;color: fuchsia;">(</span>A1,E1<span style="font-weight: 600;color: fuchsia;">)</span>,ROW<span style="font-weight: 600;color: fuchsia;">(</span>INDIRECT<span style="font-weight: 600;color: teal;">(</span>"1:10"<span style="font-weight: 600;color: teal;">)</span><span style="font-weight: 600;color: fuchsia;">)</span>-1,""<span style="font-weight: 600;color: green;">)</span><span style="font-weight: 600;color: red;">)</span><span style="font-weight: 600;color: black;">)</span><span style="font-weight: 600;color: maroon;">)</span><span style="font-weight: 600;color: blue;">)</span>&<span style="font-weight: 600;color: blue;">(</span>IF<span style="font-weight: 600;color: maroon;">(</span>LEN<span style="font-weight: 600;color: black;">(</span>A1<span style="font-weight: 600;color: black;">)</span>=E1,"",TEXT<span style="font-weight: 600;color: black;">(</span>SUM<span style="font-weight: 600;color: red;">(</span>IF<span style="font-weight: 600;color: green;">(</span>ISNUMBER<span style="font-weight: 600;color: fuchsia;">(</span>-MID<span style="font-weight: 600;color: teal;">(</span>RIGHT<span style="font-weight: 600;color: olive;">(</span>A1,LEN<span style="font-weight: 600;color: blue;">(</span>A1<span style="font-weight: 600;color: blue;">)</span>-E1<span style="font-weight: 600;color: olive;">)</span>,ROW<span style="font-weight: 600;color: olive;">(</span>INDIRECT<span style="font-weight: 600;color: blue;">(</span>"1:"&LEN<span style="font-weight: 600;color: maroon;">(</span>A1<span style="font-weight: 600;color: maroon;">)</span>-E1<span style="font-weight: 600;color: blue;">)</span><span style="font-weight: 600;color: olive;">)</span>,1<span style="font-weight: 600;color: teal;">)</span><span style="font-weight: 600;color: fuchsia;">)</span>,MID<span style="font-weight: 600;color: fuchsia;">(</span>RIGHT<span style="font-weight: 600;color: teal;">(</span>A1,LEN<span style="font-weight: 600;color: olive;">(</span>A1<span style="font-weight: 600;color: olive;">)</span>-E1<span style="font-weight: 600;color: teal;">)</span>,ROW<span style="font-weight: 600;color: teal;">(</span>INDIRECT<span style="font-weight: 600;color: olive;">(</span>"1:"&LEN<span style="font-weight: 600;color: blue;">(</span>A1<span style="font-weight: 600;color: blue;">)</span>-E1<span style="font-weight: 600;color: olive;">)</span><span style="font-weight: 600;color: teal;">)</span>,1<span style="font-weight: 600;color: fuchsia;">)</span>*10^<span style="font-weight: 600;color: fuchsia;">(</span>10*<span style="font-weight: 600;color: teal;">(</span>LEN<span style="font-weight: 600;color: olive;">(</span>A1<span style="font-weight: 600;color: olive;">)</span>-E1<span style="font-weight: 600;color: teal;">)</span>-SUMPRODUCT<span style="font-weight: 600;color: teal;">(</span>LEN<span style="font-weight: 600;color: olive;">(</span>SUBSTITUTE<span style="font-weight: 600;color: blue;">(</span>RIGHT<span style="font-weight: 600;color: maroon;">(</span>A1,LEN<span style="font-weight: 600;color: black;">(</span>A1<span style="font-weight: 600;color: black;">)</span>-E1<span style="font-weight: 600;color: maroon;">)</span>,ROW<span style="font-weight: 600;color: maroon;">(</span>INDIRECT<span style="font-weight: 600;color: black;">(</span>"1:10"<span style="font-weight: 600;color: black;">)</span><span style="font-weight: 600;color: maroon;">)</span>-1,""<span style="font-weight: 600;color: blue;">)</span><span style="font-weight: 600;color: olive;">)</span><span style="font-weight: 600;color: teal;">)</span>-10*ROW<span style="font-weight: 600;color: teal;">(</span>INDIRECT<span style="font-weight: 600;color: olive;">(</span>"1:"&LEN<span style="font-weight: 600;color: blue;">(</span>A1<span style="font-weight: 600;color: blue;">)</span>-E1<span style="font-weight: 600;color: olive;">)</span><span style="font-weight: 600;color: teal;">)</span>+MMULT<span style="font-weight: 600;color: teal;">(</span>LEN<span style="font-weight: 600;color: olive;">(</span>SUBSTITUTE<span style="font-weight: 600;color: blue;">(</span>LEFT<span style="font-weight: 600;color: maroon;">(</span>RIGHT<span style="font-weight: 600;color: black;">(</span>A1,LEN<span style="font-weight: 600;color: red;">(</span>A1<span style="font-weight: 600;color: red;">)</span>-E1<span style="font-weight: 600;color: black;">)</span>,ROW<span style="font-weight: 600;color: black;">(</span>INDIRECT<span style="font-weight: 600;color: red;">(</span>"1:"&LEN<span style="font-weight: 600;color: green;">(</span>A1<span style="font-weight: 600;color: green;">)</span>-E1<span style="font-weight: 600;color: red;">)</span><span style="font-weight: 600;color: black;">)</span><span style="font-weight: 600;color: maroon;">)</span>,TRANSPOSE<span style="font-weight: 600;color: maroon;">(</span>ROW<span style="font-weight: 600;color: black;">(</span>INDIRECT<span style="font-weight: 600;color: red;">(</span>"1:10"<span style="font-weight: 600;color: red;">)</span><span style="font-weight: 600;color: black;">)</span>-1<span style="font-weight: 600;color: maroon;">)</span>,""<span style="font-weight: 600;color: blue;">)</span><span style="font-weight: 600;color: olive;">)</span>,--<span style="font-weight: 600;color: olive;">(</span>ROW<span style="font-weight: 600;color: blue;">(</span>INDIRECT<span style="font-weight: 600;color: maroon;">(</span>"1:10"<span style="font-weight: 600;color: maroon;">)</span><span style="font-weight: 600;color: blue;">)</span>>0<span style="font-weight: 600;color: olive;">)</span><span style="font-weight: 600;color: teal;">)</span><span style="font-weight: 600;color: fuchsia;">)</span><span style="font-weight: 600;color: green;">)</span><span style="font-weight: 600;color: red;">)</span>,REPT<span style="font-weight: 600;color: red;">(</span>"0",10*<span style="font-weight: 600;color: green;">(</span>LEN<span style="font-weight: 600;color: fuchsia;">(</span>A1<span style="font-weight: 600;color: fuchsia;">)</span>-E1<span style="font-weight: 600;color: green;">)</span>-SUMPRODUCT<span style="font-weight: 600;color: green;">(</span>LEN<span style="font-weight: 600;color: fuchsia;">(</span>SUBSTITUTE<span style="font-weight: 600;color: teal;">(</span>RIGHT<span style="font-weight: 600;color: olive;">(</span>A1,LEN<span style="font-weight: 600;color: blue;">(</span>A1<span style="font-weight: 600;color: blue;">)</span>-E1<span style="font-weight: 600;color: olive;">)</span>,ROW<span style="font-weight: 600;color: olive;">(</span>INDIRECT<span style="font-weight: 600;color: blue;">(</span>"1:10"<span style="font-weight: 600;color: blue;">)</span><span style="font-weight: 600;color: olive;">)</span>-1,""<span style="font-weight: 600;color: teal;">)</span><span style="font-weight: 600;color: fuchsia;">)</span><span style="font-weight: 600;color: green;">)</span><span style="font-weight: 600;color: red;">)</span><span style="font-weight: 600;color: black;">)</span><span style="font-weight: 600;color: maroon;">)</span><span style="font-weight: 600;color: blue;">)</span> </td></tr><tr><td style="border-width:1px;border-color:#000000; padding-left:0.5em; padding-top:0.4em; padding-right:0.5em; padding-bottom:0.25em;; " > This in an array formula and so MUST be confirmed with CTRL+SHIFT+ENTER and not just ENTER.</td></tr><tr><td rowspan=2 style="border-width:1px;border-color:#000000; padding-left:0.5em; padding-top:0.4em; padding-right:0.5em; padding-bottom:0.25em;text-align:center; " >E1</td><td style="border-width:1px;border-color:#000000; padding-left:0.5em; padding-top:0.4em; padding-right:0.5em; padding-bottom:0.25em; " > =IF<span style="font-weight: 600;color: blue;">(</span>MAX<span style="font-weight: 600;color: maroon;">(</span>10*ROW<span style="font-weight: 600;color: black;">(</span>INDIRECT<span style="font-weight: 600;color: red;">(</span>"1:"&LEN<span style="font-weight: 600;color: green;">(</span>A1<span style="font-weight: 600;color: green;">)</span><span style="font-weight: 600;color: red;">)</span><span style="font-weight: 600;color: black;">)</span>-MMULT<span style="font-weight: 600;color: black;">(</span>LEN<span style="font-weight: 600;color: red;">(</span>SUBSTITUTE<span style="font-weight: 600;color: green;">(</span>LEFT<span style="font-weight: 600;color: fuchsia;">(</span>A1,ROW<span style="font-weight: 600;color: teal;">(</span>INDIRECT<span style="font-weight: 600;color: olive;">(</span>"1:"&LEN<span style="font-weight: 600;color: blue;">(</span>A1<span style="font-weight: 600;color: blue;">)</span><span style="font-weight: 600;color: olive;">)</span><span style="font-weight: 600;color: teal;">)</span><span style="font-weight: 600;color: fuchsia;">)</span>,TRANSPOSE<span style="font-weight: 600;color: fuchsia;">(</span>ROW<span style="font-weight: 600;color: teal;">(</span>INDIRECT<span style="font-weight: 600;color: olive;">(</span>"1:10"<span style="font-weight: 600;color: olive;">)</span><span style="font-weight: 600;color: teal;">)</span>-1<span style="font-weight: 600;color: fuchsia;">)</span>,""<span style="font-weight: 600;color: green;">)</span><span style="font-weight: 600;color: red;">)</span>,--<span style="font-weight: 600;color: red;">(</span>ROW<span style="font-weight: 600;color: green;">(</span>INDIRECT<span style="font-weight: 600;color: fuchsia;">(</span>"1:10"<span style="font-weight: 600;color: fuchsia;">)</span><span style="font-weight: 600;color: green;">)</span>>0<span style="font-weight: 600;color: red;">)</span><span style="font-weight: 600;color: black;">)</span><span style="font-weight: 600;color: maroon;">)</span><=15,LEN<span style="font-weight: 600;color: maroon;">(</span>A1<span style="font-weight: 600;color: maroon;">)</span>,MATCH<span style="font-weight: 600;color: maroon;">(</span>15,10*ROW<span style="font-weight: 600;color: black;">(</span>INDIRECT<span style="font-weight: 600;color: red;">(</span>"1:"&LEN<span style="font-weight: 600;color: green;">(</span>A1<span style="font-weight: 600;color: green;">)</span><span style="font-weight: 600;color: red;">)</span><span style="font-weight: 600;color: black;">)</span>-MMULT<span style="font-weight: 600;color: black;">(</span>LEN<span style="font-weight: 600;color: red;">(</span>SUBSTITUTE<span style="font-weight: 600;color: green;">(</span>LEFT<span style="font-weight: 600;color: fuchsia;">(</span>A1,ROW<span style="font-weight: 600;color: teal;">(</span>INDIRECT<span style="font-weight: 600;color: olive;">(</span>"1:"&LEN<span style="font-weight: 600;color: blue;">(</span>A1<span style="font-weight: 600;color: blue;">)</span><span style="font-weight: 600;color: olive;">)</span><span style="font-weight: 600;color: teal;">)</span><span style="font-weight: 600;color: fuchsia;">)</span>,TRANSPOSE<span style="font-weight: 600;color: fuchsia;">(</span>ROW<span style="font-weight: 600;color: teal;">(</span>INDIRECT<span style="font-weight: 600;color: olive;">(</span>"1:10"<span style="font-weight: 600;color: olive;">)</span><span style="font-weight: 600;color: teal;">)</span>-1<span style="font-weight: 600;color: fuchsia;">)</span>,""<span style="font-weight: 600;color: green;">)</span><span style="font-weight: 600;color: red;">)</span>,--<span style="font-weight: 600;color: red;">(</span>ROW<span style="font-weight: 600;color: green;">(</span>INDIRECT<span style="font-weight: 600;color: fuchsia;">(</span>"1:10"<span style="font-weight: 600;color: fuchsia;">)</span><span style="font-weight: 600;color: green;">)</span>>0<span style="font-weight: 600;color: red;">)</span><span style="font-weight: 600;color: black;">)</span>,0<span style="font-weight: 600;color: maroon;">)</span><span style="font-weight: 600;color: blue;">)</span> </td></tr><tr><td style="border-width:1px;border-color:#000000; padding-left:0.5em; padding-top:0.4em; padding-right:0.5em; padding-bottom:0.25em;; " > This in an array formula and so MUST be confirmed with CTRL+SHIFT+ENTER and not just ENTER.</td></tr></table>
This is my craziest formula and one of the craziest I've seen. The equivalent vba is just a couple of statements!
The formula extracts digits out of a string. Only works in xl2007 as some functions are deeply nested. Uses an auxilliary formula or else it would be unmanageable.
Extracts up to 30 digits.
I'm sure there must be a simpler solution (like, for ex., any other solution) but it was fun to build.
<table border="1" cellpadding="1" style="background:#FFF; border-collapse:collapse;border-width:2px;border-color:#CCCCCC;font-family:Arial,Arial; font-size:10pt" ><tr><th style="border-width:1px;border-color:#888888;background:#9CF " > </th><th style="border-width:1px;border-color:#888888;background:#9CF; text-align:center" >A</th><th style="border-width:1px;border-color:#888888;background:#9CF; text-align:center" width=30 >B</th><th style="border-width:1px;border-color:#888888;background:#9CF; text-align:center" >C</th><th style="border-width:1px;border-color:#888888;background:#9CF; text-align:center" width=30 >D</th><th style="border-width:1px;border-color:#888888;background:#9CF; text-align:center" width=30 >E</th></tr><tr><td style="border-width:1px;border-color:#000000; padding-left:0.5em; padding-top:0.4em; padding-right:0.5em; padding-bottom:0.25em;background:#9CF; text-align:center; " ><b>1</b></td><td style="border-width:1px;border-color:#000000; padding-left:0.5em; padding-top:0.4em; padding-right:0.5em; padding-bottom:0.25em;text-align:left;border-width: 1px;border-color:#888888; ">0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610</td><td style="border-width:1px;border-color:#000000; padding-left:0.5em; padding-top:0.4em; padding-right:0.5em; padding-bottom:0.25em;text-align:right;border-width: 1px;border-color:#888888; "> </td><td style="border-width:1px;border-color:#000000; padding-left:0.5em; padding-top:0.4em; padding-right:0.5em; padding-bottom:0.25em;text-align:left;border-width: 1px;border-color:#888888; ">01123581321345589144233377610</td><td style="border-width:1px;border-color:#000000; padding-left:0.5em; padding-top:0.4em; padding-right:0.5em; padding-bottom:0.25em;text-align:right;border-width: 1px;border-color:#888888; "> </td><td style="border-width:1px;border-color:#000000; padding-left:0.5em; padding-top:0.4em; padding-right:0.5em; padding-bottom:0.25em;text-align:right;border-width: 1px;border-color:#888888; ">35</td></tr><tr><td style="border-width:1px;border-color:#000000; padding-left:0.5em; padding-top:0.4em; padding-right:0.5em; padding-bottom:0.25em;background:#9CF; text-align:center; " ><b>2</b></td><td style="border-width:1px;border-color:#000000; padding-left:0.5em; padding-top:0.4em; padding-right:0.5em; padding-bottom:0.25em;text-align:left;border-width: 1px;border-color:#888888; ">0 Mary 123-456 had a 7890 987.654 little 321 lamb 0</td><td style="border-width:1px;border-color:#000000; padding-left:0.5em; padding-top:0.4em; padding-right:0.5em; padding-bottom:0.25em;text-align:right;border-width: 1px;border-color:#888888; "> </td><td style="border-width:1px;border-color:#000000; padding-left:0.5em; padding-top:0.4em; padding-right:0.5em; padding-bottom:0.25em;text-align:left;border-width: 1px;border-color:#888888; ">012345678909876543210</td><td style="border-width:1px;border-color:#000000; padding-left:0.5em; padding-top:0.4em; padding-right:0.5em; padding-bottom:0.25em;text-align:right;border-width: 1px;border-color:#888888; "> </td><td style="border-width:1px;border-color:#000000; padding-left:0.5em; padding-top:0.4em; padding-right:0.5em; padding-bottom:0.25em;text-align:right;border-width: 1px;border-color:#888888; ">31</td></tr><tr><td colspan=6 style="background:#9CF; padding-left:1em" > [ExtractDigits.xlsb]Sol xl2007</td></tr></table><br>
<br>
<table border="1" cellpadding="1" style="background:#FFF; border-collapse:collapse;border-width:2px;border-color:#CCCCCC;font-family:Arial,Arial; font-size:10pt" ><tr><td style="border-width:1px;border-color:#000000; padding-left:0.5em; padding-top:0.4em; padding-right:0.5em; padding-bottom:0.25em;background:#9CF; " >Addr</td><td style="border-width:1px;border-color:#000000; padding-left:0.5em; padding-top:0.4em; padding-right:0.5em; padding-bottom:0.25em;background:#9CF; " >Formula</td></tr><tr><td colspan=2 style="border-width:1px;border-color:#000000; padding-left:0.5em; padding-top:0.4em; padding-right:0.5em; padding-bottom:0.25em;background:#9CF; " >[ExtractDigits.xlsb]Sol xl2007</td></tr><tr><td rowspan=2 style="border-width:1px;border-color:#000000; padding-left:0.5em; padding-top:0.4em; padding-right:0.5em; padding-bottom:0.25em;text-align:center; " >C1</td><td style="border-width:1px;border-color:#000000; padding-left:0.5em; padding-top:0.4em; padding-right:0.5em; padding-bottom:0.25em; " > =TEXT<span style="font-weight: 600;color: blue;">(</span>SUM<span style="font-weight: 600;color: maroon;">(</span>IF<span style="font-weight: 600;color: black;">(</span>ISNUMBER<span style="font-weight: 600;color: red;">(</span>-MID<span style="font-weight: 600;color: green;">(</span>A1,ROW<span style="font-weight: 600;color: fuchsia;">(</span>INDIRECT<span style="font-weight: 600;color: teal;">(</span>"1:"&E1<span style="font-weight: 600;color: teal;">)</span><span style="font-weight: 600;color: fuchsia;">)</span>,1<span style="font-weight: 600;color: green;">)</span><span style="font-weight: 600;color: red;">)</span>,MID<span style="font-weight: 600;color: red;">(</span>A1,ROW<span style="font-weight: 600;color: green;">(</span>INDIRECT<span style="font-weight: 600;color: fuchsia;">(</span>"1:"&E1<span style="font-weight: 600;color: fuchsia;">)</span><span style="font-weight: 600;color: green;">)</span>,1<span style="font-weight: 600;color: red;">)</span>*10^<span style="font-weight: 600;color: red;">(</span>10*E1-SUMPRODUCT<span style="font-weight: 600;color: green;">(</span>LEN<span style="font-weight: 600;color: fuchsia;">(</span>SUBSTITUTE<span style="font-weight: 600;color: teal;">(</span>LEFT<span style="font-weight: 600;color: olive;">(</span>A1,E1<span style="font-weight: 600;color: olive;">)</span>,ROW<span style="font-weight: 600;color: olive;">(</span>INDIRECT<span style="font-weight: 600;color: blue;">(</span>"1:10"<span style="font-weight: 600;color: blue;">)</span><span style="font-weight: 600;color: olive;">)</span>-1,""<span style="font-weight: 600;color: teal;">)</span><span style="font-weight: 600;color: fuchsia;">)</span><span style="font-weight: 600;color: green;">)</span>-10*ROW<span style="font-weight: 600;color: green;">(</span>INDIRECT<span style="font-weight: 600;color: fuchsia;">(</span>"1:"&E1<span style="font-weight: 600;color: fuchsia;">)</span><span style="font-weight: 600;color: green;">)</span>+MMULT<span style="font-weight: 600;color: green;">(</span>LEN<span style="font-weight: 600;color: fuchsia;">(</span>SUBSTITUTE<span style="font-weight: 600;color: teal;">(</span>LEFT<span style="font-weight: 600;color: olive;">(</span>A1,ROW<span style="font-weight: 600;color: blue;">(</span>INDIRECT<span style="font-weight: 600;color: maroon;">(</span>"1:"&E1<span style="font-weight: 600;color: maroon;">)</span><span style="font-weight: 600;color: blue;">)</span><span style="font-weight: 600;color: olive;">)</span>,TRANSPOSE<span style="font-weight: 600;color: olive;">(</span>ROW<span style="font-weight: 600;color: blue;">(</span>INDIRECT<span style="font-weight: 600;color: maroon;">(</span>"1:10"<span style="font-weight: 600;color: maroon;">)</span><span style="font-weight: 600;color: blue;">)</span>-1<span style="font-weight: 600;color: olive;">)</span>,""<span style="font-weight: 600;color: teal;">)</span><span style="font-weight: 600;color: fuchsia;">)</span>,--<span style="font-weight: 600;color: fuchsia;">(</span>ROW<span style="font-weight: 600;color: teal;">(</span>INDIRECT<span style="font-weight: 600;color: olive;">(</span>"1:10"<span style="font-weight: 600;color: olive;">)</span><span style="font-weight: 600;color: teal;">)</span>>0<span style="font-weight: 600;color: fuchsia;">)</span><span style="font-weight: 600;color: green;">)</span><span style="font-weight: 600;color: red;">)</span><span style="font-weight: 600;color: black;">)</span><span style="font-weight: 600;color: maroon;">)</span>,REPT<span style="font-weight: 600;color: maroon;">(</span>"0",10*E1-SUMPRODUCT<span style="font-weight: 600;color: black;">(</span>LEN<span style="font-weight: 600;color: red;">(</span>SUBSTITUTE<span style="font-weight: 600;color: green;">(</span>LEFT<span style="font-weight: 600;color: fuchsia;">(</span>A1,E1<span style="font-weight: 600;color: fuchsia;">)</span>,ROW<span style="font-weight: 600;color: fuchsia;">(</span>INDIRECT<span style="font-weight: 600;color: teal;">(</span>"1:10"<span style="font-weight: 600;color: teal;">)</span><span style="font-weight: 600;color: fuchsia;">)</span>-1,""<span style="font-weight: 600;color: green;">)</span><span style="font-weight: 600;color: red;">)</span><span style="font-weight: 600;color: black;">)</span><span style="font-weight: 600;color: maroon;">)</span><span style="font-weight: 600;color: blue;">)</span>&<span style="font-weight: 600;color: blue;">(</span>IF<span style="font-weight: 600;color: maroon;">(</span>LEN<span style="font-weight: 600;color: black;">(</span>A1<span style="font-weight: 600;color: black;">)</span>=E1,"",TEXT<span style="font-weight: 600;color: black;">(</span>SUM<span style="font-weight: 600;color: red;">(</span>IF<span style="font-weight: 600;color: green;">(</span>ISNUMBER<span style="font-weight: 600;color: fuchsia;">(</span>-MID<span style="font-weight: 600;color: teal;">(</span>RIGHT<span style="font-weight: 600;color: olive;">(</span>A1,LEN<span style="font-weight: 600;color: blue;">(</span>A1<span style="font-weight: 600;color: blue;">)</span>-E1<span style="font-weight: 600;color: olive;">)</span>,ROW<span style="font-weight: 600;color: olive;">(</span>INDIRECT<span style="font-weight: 600;color: blue;">(</span>"1:"&LEN<span style="font-weight: 600;color: maroon;">(</span>A1<span style="font-weight: 600;color: maroon;">)</span>-E1<span style="font-weight: 600;color: blue;">)</span><span style="font-weight: 600;color: olive;">)</span>,1<span style="font-weight: 600;color: teal;">)</span><span style="font-weight: 600;color: fuchsia;">)</span>,MID<span style="font-weight: 600;color: fuchsia;">(</span>RIGHT<span style="font-weight: 600;color: teal;">(</span>A1,LEN<span style="font-weight: 600;color: olive;">(</span>A1<span style="font-weight: 600;color: olive;">)</span>-E1<span style="font-weight: 600;color: teal;">)</span>,ROW<span style="font-weight: 600;color: teal;">(</span>INDIRECT<span style="font-weight: 600;color: olive;">(</span>"1:"&LEN<span style="font-weight: 600;color: blue;">(</span>A1<span style="font-weight: 600;color: blue;">)</span>-E1<span style="font-weight: 600;color: olive;">)</span><span style="font-weight: 600;color: teal;">)</span>,1<span style="font-weight: 600;color: fuchsia;">)</span>*10^<span style="font-weight: 600;color: fuchsia;">(</span>10*<span style="font-weight: 600;color: teal;">(</span>LEN<span style="font-weight: 600;color: olive;">(</span>A1<span style="font-weight: 600;color: olive;">)</span>-E1<span style="font-weight: 600;color: teal;">)</span>-SUMPRODUCT<span style="font-weight: 600;color: teal;">(</span>LEN<span style="font-weight: 600;color: olive;">(</span>SUBSTITUTE<span style="font-weight: 600;color: blue;">(</span>RIGHT<span style="font-weight: 600;color: maroon;">(</span>A1,LEN<span style="font-weight: 600;color: black;">(</span>A1<span style="font-weight: 600;color: black;">)</span>-E1<span style="font-weight: 600;color: maroon;">)</span>,ROW<span style="font-weight: 600;color: maroon;">(</span>INDIRECT<span style="font-weight: 600;color: black;">(</span>"1:10"<span style="font-weight: 600;color: black;">)</span><span style="font-weight: 600;color: maroon;">)</span>-1,""<span style="font-weight: 600;color: blue;">)</span><span style="font-weight: 600;color: olive;">)</span><span style="font-weight: 600;color: teal;">)</span>-10*ROW<span style="font-weight: 600;color: teal;">(</span>INDIRECT<span style="font-weight: 600;color: olive;">(</span>"1:"&LEN<span style="font-weight: 600;color: blue;">(</span>A1<span style="font-weight: 600;color: blue;">)</span>-E1<span style="font-weight: 600;color: olive;">)</span><span style="font-weight: 600;color: teal;">)</span>+MMULT<span style="font-weight: 600;color: teal;">(</span>LEN<span style="font-weight: 600;color: olive;">(</span>SUBSTITUTE<span style="font-weight: 600;color: blue;">(</span>LEFT<span style="font-weight: 600;color: maroon;">(</span>RIGHT<span style="font-weight: 600;color: black;">(</span>A1,LEN<span style="font-weight: 600;color: red;">(</span>A1<span style="font-weight: 600;color: red;">)</span>-E1<span style="font-weight: 600;color: black;">)</span>,ROW<span style="font-weight: 600;color: black;">(</span>INDIRECT<span style="font-weight: 600;color: red;">(</span>"1:"&LEN<span style="font-weight: 600;color: green;">(</span>A1<span style="font-weight: 600;color: green;">)</span>-E1<span style="font-weight: 600;color: red;">)</span><span style="font-weight: 600;color: black;">)</span><span style="font-weight: 600;color: maroon;">)</span>,TRANSPOSE<span style="font-weight: 600;color: maroon;">(</span>ROW<span style="font-weight: 600;color: black;">(</span>INDIRECT<span style="font-weight: 600;color: red;">(</span>"1:10"<span style="font-weight: 600;color: red;">)</span><span style="font-weight: 600;color: black;">)</span>-1<span style="font-weight: 600;color: maroon;">)</span>,""<span style="font-weight: 600;color: blue;">)</span><span style="font-weight: 600;color: olive;">)</span>,--<span style="font-weight: 600;color: olive;">(</span>ROW<span style="font-weight: 600;color: blue;">(</span>INDIRECT<span style="font-weight: 600;color: maroon;">(</span>"1:10"<span style="font-weight: 600;color: maroon;">)</span><span style="font-weight: 600;color: blue;">)</span>>0<span style="font-weight: 600;color: olive;">)</span><span style="font-weight: 600;color: teal;">)</span><span style="font-weight: 600;color: fuchsia;">)</span><span style="font-weight: 600;color: green;">)</span><span style="font-weight: 600;color: red;">)</span>,REPT<span style="font-weight: 600;color: red;">(</span>"0",10*<span style="font-weight: 600;color: green;">(</span>LEN<span style="font-weight: 600;color: fuchsia;">(</span>A1<span style="font-weight: 600;color: fuchsia;">)</span>-E1<span style="font-weight: 600;color: green;">)</span>-SUMPRODUCT<span style="font-weight: 600;color: green;">(</span>LEN<span style="font-weight: 600;color: fuchsia;">(</span>SUBSTITUTE<span style="font-weight: 600;color: teal;">(</span>RIGHT<span style="font-weight: 600;color: olive;">(</span>A1,LEN<span style="font-weight: 600;color: blue;">(</span>A1<span style="font-weight: 600;color: blue;">)</span>-E1<span style="font-weight: 600;color: olive;">)</span>,ROW<span style="font-weight: 600;color: olive;">(</span>INDIRECT<span style="font-weight: 600;color: blue;">(</span>"1:10"<span style="font-weight: 600;color: blue;">)</span><span style="font-weight: 600;color: olive;">)</span>-1,""<span style="font-weight: 600;color: teal;">)</span><span style="font-weight: 600;color: fuchsia;">)</span><span style="font-weight: 600;color: green;">)</span><span style="font-weight: 600;color: red;">)</span><span style="font-weight: 600;color: black;">)</span><span style="font-weight: 600;color: maroon;">)</span><span style="font-weight: 600;color: blue;">)</span> </td></tr><tr><td style="border-width:1px;border-color:#000000; padding-left:0.5em; padding-top:0.4em; padding-right:0.5em; padding-bottom:0.25em;; " > This in an array formula and so MUST be confirmed with CTRL+SHIFT+ENTER and not just ENTER.</td></tr><tr><td rowspan=2 style="border-width:1px;border-color:#000000; padding-left:0.5em; padding-top:0.4em; padding-right:0.5em; padding-bottom:0.25em;text-align:center; " >E1</td><td style="border-width:1px;border-color:#000000; padding-left:0.5em; padding-top:0.4em; padding-right:0.5em; padding-bottom:0.25em; " > =IF<span style="font-weight: 600;color: blue;">(</span>MAX<span style="font-weight: 600;color: maroon;">(</span>10*ROW<span style="font-weight: 600;color: black;">(</span>INDIRECT<span style="font-weight: 600;color: red;">(</span>"1:"&LEN<span style="font-weight: 600;color: green;">(</span>A1<span style="font-weight: 600;color: green;">)</span><span style="font-weight: 600;color: red;">)</span><span style="font-weight: 600;color: black;">)</span>-MMULT<span style="font-weight: 600;color: black;">(</span>LEN<span style="font-weight: 600;color: red;">(</span>SUBSTITUTE<span style="font-weight: 600;color: green;">(</span>LEFT<span style="font-weight: 600;color: fuchsia;">(</span>A1,ROW<span style="font-weight: 600;color: teal;">(</span>INDIRECT<span style="font-weight: 600;color: olive;">(</span>"1:"&LEN<span style="font-weight: 600;color: blue;">(</span>A1<span style="font-weight: 600;color: blue;">)</span><span style="font-weight: 600;color: olive;">)</span><span style="font-weight: 600;color: teal;">)</span><span style="font-weight: 600;color: fuchsia;">)</span>,TRANSPOSE<span style="font-weight: 600;color: fuchsia;">(</span>ROW<span style="font-weight: 600;color: teal;">(</span>INDIRECT<span style="font-weight: 600;color: olive;">(</span>"1:10"<span style="font-weight: 600;color: olive;">)</span><span style="font-weight: 600;color: teal;">)</span>-1<span style="font-weight: 600;color: fuchsia;">)</span>,""<span style="font-weight: 600;color: green;">)</span><span style="font-weight: 600;color: red;">)</span>,--<span style="font-weight: 600;color: red;">(</span>ROW<span style="font-weight: 600;color: green;">(</span>INDIRECT<span style="font-weight: 600;color: fuchsia;">(</span>"1:10"<span style="font-weight: 600;color: fuchsia;">)</span><span style="font-weight: 600;color: green;">)</span>>0<span style="font-weight: 600;color: red;">)</span><span style="font-weight: 600;color: black;">)</span><span style="font-weight: 600;color: maroon;">)</span><=15,LEN<span style="font-weight: 600;color: maroon;">(</span>A1<span style="font-weight: 600;color: maroon;">)</span>,MATCH<span style="font-weight: 600;color: maroon;">(</span>15,10*ROW<span style="font-weight: 600;color: black;">(</span>INDIRECT<span style="font-weight: 600;color: red;">(</span>"1:"&LEN<span style="font-weight: 600;color: green;">(</span>A1<span style="font-weight: 600;color: green;">)</span><span style="font-weight: 600;color: red;">)</span><span style="font-weight: 600;color: black;">)</span>-MMULT<span style="font-weight: 600;color: black;">(</span>LEN<span style="font-weight: 600;color: red;">(</span>SUBSTITUTE<span style="font-weight: 600;color: green;">(</span>LEFT<span style="font-weight: 600;color: fuchsia;">(</span>A1,ROW<span style="font-weight: 600;color: teal;">(</span>INDIRECT<span style="font-weight: 600;color: olive;">(</span>"1:"&LEN<span style="font-weight: 600;color: blue;">(</span>A1<span style="font-weight: 600;color: blue;">)</span><span style="font-weight: 600;color: olive;">)</span><span style="font-weight: 600;color: teal;">)</span><span style="font-weight: 600;color: fuchsia;">)</span>,TRANSPOSE<span style="font-weight: 600;color: fuchsia;">(</span>ROW<span style="font-weight: 600;color: teal;">(</span>INDIRECT<span style="font-weight: 600;color: olive;">(</span>"1:10"<span style="font-weight: 600;color: olive;">)</span><span style="font-weight: 600;color: teal;">)</span>-1<span style="font-weight: 600;color: fuchsia;">)</span>,""<span style="font-weight: 600;color: green;">)</span><span style="font-weight: 600;color: red;">)</span>,--<span style="font-weight: 600;color: red;">(</span>ROW<span style="font-weight: 600;color: green;">(</span>INDIRECT<span style="font-weight: 600;color: fuchsia;">(</span>"1:10"<span style="font-weight: 600;color: fuchsia;">)</span><span style="font-weight: 600;color: green;">)</span>>0<span style="font-weight: 600;color: red;">)</span><span style="font-weight: 600;color: black;">)</span>,0<span style="font-weight: 600;color: maroon;">)</span><span style="font-weight: 600;color: blue;">)</span> </td></tr><tr><td style="border-width:1px;border-color:#000000; padding-left:0.5em; padding-top:0.4em; padding-right:0.5em; padding-bottom:0.25em;; " > This in an array formula and so MUST be confirmed with CTRL+SHIFT+ENTER and not just ENTER.</td></tr></table>