# Questions from the 2013 Modeloff awards ceremony

#### Peter_SSs

##### MrExcel MVP, Moderator
But that wasn't what they were asked to do, so don't be too hard on them
No, fair enough.

... devise the shortest formula that they could, which would solve the precise challenge in front of them.
OK, given that (and lots more time to ponder) I now offer a modification of the stated solution that solves the "precise challenge" with just 30 characters. Still array-entered:

SUM(\$E\$18:\$H\$21*(B15:E18=100))

### Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

#### DanMayoh

##### New Member
Hi Peter, good pick up, and you raise an interesting point. You're right this solves the "precise challenge", but it doesn't reflect the intention of my previous comment, which I suppose I poorly explained. I meant that they needed a formula which would work for the precise workbook in front of them, but still be flexible enough to handle changes to the 'user-variable' cells in the workbook. In other words, the formula should be able to accommodate changes to the numbers, which were formatted as user-variable, but does not need to accommodate things like people adding or deleting rows/columns. Discussions like this are very useful for the next time I may run something similar, as they will help me articulate the guidelines better, so thank you!

I know I didn't include a formatting legend, but for the competition on the day this was ok because the competitors had seen the ModelOff organisers use the same formatting all day and all knew those yellow cells were to be taken as user-variable. If you take your approach to the extreme, then for Q3 posted at the top of this thread you could just write "=158", which I think we'd all agree should not be awarded as the shortest solution. Cheers.

#### Peter_SSs

##### MrExcel MVP, Moderator
I meant that they needed a formula which would work for the precise workbook in front of them, but still be flexible enough to handle changes to the 'user-variable' cells in the workbook. In other words, the formula should be able to accommodate changes to the numbers, which were formatted as user-variable, ...
Dan
I'm not trying to get into an argument here and I like the challenges set, but I am getting a little confused.

My original assumption was as you state here - that the 'Original Square' of numbers could be any numbers. However, the accepted solution does not meet this test - as I pointed out earlier in this thread.
Following that you stated the following from which I could only conclude that the Original Square was not changeable.
.. were given the explicit instruction to devise the shortest formula that they could, which would solve the precise challenge in front of them.
To recap my point from post #5 relating to this:
Whilst the stated solution does produce a correct result for the given layout and given data, it is not robust regarding other data sets. .... this solution relies on the top left cell being unique within the data set. With 100 still in cell E18, change any of the other cells in the "original square" to 100 and observe the results.
In the example below I've highlighted one changed Original Square cell and the resulting incorrect answer cells.

Excel Workbook
EFGHIJKLM
18100111112114
197
193186174
19100126135136348342333316
20142147149151287284273242
21174186193197250247237200
challenge2

The upshot for me then is that the "winners" of this particular challenge were a little lucky to be awarded that status.

Last edited:

#### DanMayoh

##### New Member
Of course you are right Peter, and I'm not trying to argue either. All of your comments have been very useful!
The same thought occurred to me after I posted last my comment - namely that if the top left value was repeated somewhere, the 'winning' formula wouldn't work. And you had indeed already pointed this out in earlier comments, which I forgot about when writing my comment.
I didn't pick this constraint up on the competition day as I literally had about 10 seconds to adjudicate formulas, and I didn't in that time fully think through the ramifications of how the formula worked. (This particular aspect of the competition was a "fun" event in front of a live audience, and did not have any bearing on the main ModelOff result.)
If a competitor on the day used your "...=100))" formula, perhaps I would have judged it worthy of winning - especially if they pointed out the shortcoming in the "...=\$E\$18))" formula.
Apologies for being imprecise in my earlier comments. As I said before, these are valuable lessons for me in the event ModelOff runs something similar again!

#### Peter_SSs

##### MrExcel MVP, Moderator
OK, understand the difficulties in making an on-the-spot decision on the day.

Last edited:

#### Nicolas Favre

##### New Member
Here is my working solution to #4 with only 34 characters :

=MAX(,INT((H\$17-\$E19)/\$F19/365+1))

#### stefankemp

##### Board Regular
No, fair enough.

OK, given that (and lots more time to ponder) I now offer a modification of the stated solution that solves the "precise challenge" with just 30 characters. Still array-entered:

SUM(\$E\$18:\$H\$21*(B15:E18=100))
Nice solution Peter. Don't think you can get shorter than that.

#### gigidica

##### New Member
This is an excellent solution. My solution was:
=INDIRECT("R"&ROW(J18)+2*(19-ROW(\$J18))+1&"C"&COLUMN(J18)-2*(COLUMN(J\$18)-9),FALSE)
It gave me a length of 83 and I agree that is not as robust....