Not really a question . . . . . . . . . .

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>
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
It seems there isn't a 'vomiting smilie' which is what I think I need after trying to decipher that formula, Pedro ;-)

You crazy nutter!
 
I'm very disappointed Richard. Why don't you like my beautiful formula? :cry:

At least I hope you meant
icon_vomit.gif
and not
barf.gif
 
Last edited:
I'm very disappointed Richard. Why don't you like my beautiful formula? :cry:

At least I hope you meant
icon_vomit.gif
and not
barf.gif

It's like an Excel version of Joseph and His Amazing Technicolour Dreamcoat. Although thinking about it that was pretty vomit inducing too! :laugh:
 
No morefunc add-in, pgc?

C1 {=SUBSTITUTE(MCONCAT(IF(ISNUMBER(MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1)+0),MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1)),""),"FALSE","")}
 
No morefunc add-in, pgc?

C1 {=SUBSTITUTE(MCONCAT(IF(ISNUMBER(MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1)+0),MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1)),""),"FALSE","")}

Hi Oaktree

No. Just excel native functions, no vba, yours or someone else's (add-in).

The problem with this type of formulas is exactly that the worksheet function Concatenate() does not accept a range or an array.

This could be done in vba in a couple of statements, but then it would be no fun.

I would not use this formula in real life but I thought it fits this thread, as it's about big and crazy formulas. :-D
 
=IF(OR(BG$9=0,$Z135>BG$6,$AA135<BG$6),0,IF($AD135=1,($W135-BG$8)*($U135*BG$10)*BG$11,IF($AD135=2,($W135-BG$9)*$U135*BG$11,IF($AD135=3,ROUND(IF(AND(BG$9>$Y135,$Y135>0),($Y135-BG$9)*$U135*BG$11,IF(AND(BG$9<$X135,$X135>0),($X135-BG$9)*$U135*BG$11)),2),0))))
This one is used in an internal hedge calulation, it is looking to see if it should calc the hegde position.


=IF(ISERROR(INDEX('Production Information'!$F$3:$T$15000,SMALL(IF('Production Information'!$F$3:$F$15000=($C$5&$D$5&$E17),ROW('Production Information'!$F$3:$F$15000)-ROW('Production Information'!$F$3)+1,ROW('Production Information'!$F$15000)+1),V$6),V$7)),0,INDEX('Production Information'!$F$3:$T$15000,SMALL(IF('Production Information'!$F$3:$F$15000=($C$5&$D$5&$E17),ROW('Production Information'!$F$3:$F$15000)-ROW('Production Information'!$F$3)+1,ROW('Production Information'!$F$15000)+1),V$6),V$7))

This one was made bfore Aladin enlightened me with the
Code:
 =lookup(9.9999e+307,Choose({1,2},0,Formula))

This beast goes into a data dump and pulls out specific bits of information and I'm not sure I can remember how it even works anymore, but it works. Takes about 45 seconds to run....

One more...

=ROUND(IF(AND($BK97>=I$4,$BL97>=I$5,$BK97<I$5),I$5-$BK97+1,IF(AND($BL97>I$4,$BK97<=I$4,I$5>=$BL97),$BL97-I$4+1,IF(AND(($BK97+1)>I$4,$BL97>I$4,$BL97<I$5),$BL97-$BK97+1,IF(OR(AND($BK97<I$4,$BL97>I$5),AND($BK97=I$4,$BL97=I$5)),I$5-I$4+1,0))))/I$3*$BI97,1)

This one was difficult to get to work. Mostly because it had to verify if a date was before the first of the month, or started in the month, was after the end of the month, and then calculate appropriately. Because of the stuff I have learned on the board I probably could do this more efficiently.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
 
Code:
=IF('Main Data Entry Sheet'!K157=1,SUM('Main Data Entry Sheet'!K156*'Main Data Entry Sheet'!K157,IF(AND('Main Data Entry Sheet'!K157=1,MID('Case I comp'!B263,1,1)="R"),'Case I comp'!B260*-1,0),'Main Data Entry Sheet'!K158*'Main Data Entry Sheet'!K159,IF(AND('Main Data Entry Sheet'!K159=1,MID('Case I comp'!C263,1,1)="R"),'Case I comp'!C260*-1,0)),SUM('Main Data Entry Sheet'!K156*'Main Data Entry Sheet'!K157,'Main Data Entry Sheet'!K158*'Main Data Entry Sheet'!K159))*'Main Data Entry Sheet'!B155
This formula computed the tax allowable value of Plant & machinery purchased during an accounting period under current Irish Corporation tax legislation. I had to allow for factors such as :

1. date of purchase/ use;
2. whether a maximum allowed cost was exceeded;
3. whether the company had a 'replacement option' available to it (to defer a tax charge arising on the sale of an old asset).

The data in the Excel file was used to output (via mailmerge) both an exam question and solution in minutes rather than hours! It's very clunky (I was unaware at the time of the SUMPRODUCT function). As a medium term project I hope to improve the file but am feeling a little overwhelmed at the prospect!
 
That Variant is way cool. I'd not seen it either. I'm in the, "I'm not worthy" category amongst the men of greatness here, but the one I'm still amazing over lately is this answer from Aladin.

You could create on every relevant sheet an additional column, say, G, with"

=MONTH(A2)

Then invoke:

=SUMPRODUCT(SUMIF(INDIRECT("'"&SheetList&"'!G2:G188"),MONTH($A6),INDIRECT("'"&SheetList&"'!F2:F188")))

where SheetList refers to a range housing the relevant sheet names, that is, 3107, 3207, etc.
 
One I was recently proud of:


=IF(AND(MATCH(Data!K2152,Props!$F$1:$F$211,0)<>11,
MATCH(Data!K2152,Props!$F$1:$F$211,0)<>12,MATCH(Data!K2152,Props!$F$1:$F$211,0)
<>14),CONCATENATE(K2152,RIGHT(Props!$K$26,8)),IF
(MATCH(Data!K2152,Props!$F$1:$F$211,0)=11,VLOOKUP(IF(ISNA(RIGHT(G2152,2)),
VALUE(RIGHT(G2152,2)),RIGHT(G2152,2)),Props!$J$2:$K$16,2,0),IF(
MATCH(Data!K2152,Props!$F$1:$F$211,0)=12,VLOOKUP(IF(ISNA(RIGHT(G2152,2)),
VALUE(RIGHT(G2152,2)),RIGHT(G2152,2)),Props!$J$29:$K$39,2,0),VLOOKUP(IF(ISNA(
RIGHT(G2152,2)),VALUE(RIGHT(G2152,2)),RIGHT(G2152,2)),Props!$J$19:$K$23,2,0))))


Quite straightforward really.
 

Forum statistics

Threads
1,223,758
Messages
6,174,334
Members
452,555
Latest member
colc007

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