• We are pleased to announce that the winner of our Feedback Prize Draw for the Winter 2024-25 session and winning £150 of gift vouchers is Zhao Liang Tay. Congratulations to Zhao Liang. If you fancy winning £150 worth of gift vouchers (from a major UK store) for the Summer 2025 exam sitting for just a few minutes of your time throughout the session, please see our website at https://www.acted.co.uk/further-info.html?pat=feedback#feedback-prize for more information on how you can make sure your name is included in the draw at the end of the session.
  • Please be advised that the SP1, SP5 and SP7 X1 deadline is the 14th July and not the 17th June as first stated. Please accept out apologies for any confusion caused.

Excel Challenge #2

It can be reduced further by changing LEFT(String,1) to LEFT(String), which appears to give the first letter by default.

Also, you do not need to specify the formula to give 0 if the test is false, so the ,0 part can also be removed:

Code:
=IF(SUM(IF(MID(A1,ROW(A:A),1)=LEFT(RIGHT(A1,ROW(A:A))),1))=LEN(A1),,"No ")&"Palindrome"

which is 86 characters.

I feel we're just refining it now so...back to study!
 
This may be considered cheating ;), but if you change the cell formatting to
Code:
"Palindrome";;"No palindrome"
then the following solution only requires 66 characters
Code:
=--(SUM(IF(MID(A1,ROW(A:A),1)=LEFT(RIGHT(A1,ROW(A:A))),1))=LEN(A1))
 
CA2 examiners would go mad.....and I like it!

edit: by the same logic, we could use:

Code:
(SUM((MID(A1,ROW(A:A),1)=LEFT(RIGHT(A1,ROW(A:A))))*1)=LEN(A1))*1

for 64 characters!
 
Last edited by a moderator:
This attempt has a character count of 56.

Code:
=--AND(RIGHT(LEFT(A1,ROW(A:A)))=LEFT(RIGHT(A1,ROW(A:A))))

The MID function had to be abandoned because MID(string,x,1) returns "" when x>len(string), whereas RIGHT(LEFT(string,x)) just gives RIGHT(string) for large values of x.
 
Nice one! I tried to change the approach by using the SEARCH() function to reduce the character count but to no avail.

Although only one "-" sign is needed, with a result of -1 verifying it is a palindrome :)
 
There haven't been any new suggestions for a couple of days, so it looks as though maz1987 is this month's winner - well done! Here's a summary of the final submission;

Code:
=-AND(RIGHT(LEFT(A1,ROW(A:A)))=LEFT(RIGHT(A1,ROW(A:A))))

with the number formatting set to

Code:
;"Palindrome";"No palindrome"

That puts the character count at 55.

Watch out for Excel Challenge #3 - launching Friday 10th April 2015. :)
 
I couldn't possibly accept that after I simply removed one character from your attempt!

Look forward to the third..
 
Back
Top