The Daily WTF
Follow
Representative Line: Dating Backwards
The text critiques an Excel formula written by a developer for date conversion. The formula, written in French Excel functions, aims to transform dates in DD/MM/YYYY format into YYMMDD format. This formula uses convoluted logic involving conditional statements and multiplication to achieve padding for month and day values. The formula exhibits significant flaws, particularly in handling months and decades, leading to incorrect date representations. The author highlights the problems with the formula, using the example of February 1st, 2009. The author correctly points out that this formula will break in the year 2100. The text contrasts this flawed approach with the readily available, built-in formatting functions in Excel to correctly change date formats. The author mentions that using the appropriate built-in formatting functions would be much easier. The author suggests even concatenating the components of a date string would be preferable to the convoluted integer triplet approach of the formula. This is because the input format is guaranteed to have correct padding. The author concludes the formula's complexity suggests a software developer crafted it, not a typical Excel user. The text concludes with a brief advertisement for a NuGet feed service.