Results 1 to 5 of 5

Thread: Spell a Date out in Words

Threaded View

Rick Rothstein Spell a Date out in Words 02-22-2012, 11:13 PM
Haseeb A Nice one Rick as usual :) ... 02-25-2012, 03:12 AM
Rick Rothstein Thank you, although I haven't... 02-25-2012, 07:05 AM
Rick Rothstein Okay, I thought about it and... 02-25-2012, 08:30 AM
Rick Rothstein There was a bug in my last... 02-25-2012, 08:49 PM
Previous Post Previous Post   Next Post Next Post
  1. #3
    Forum Guru Rick Rothstein's Avatar
    Join Date
    Feb 2012
    Posts
    662
    Rep Power
    14
    Quote Originally Posted by Haseeb Avarakkan View Post
    Nice one Rick as usual
    Thank you, although I haven't really posted in this forum enough to have an "as usual" yet, have I?

    Quote Originally Posted by Haseeb Avarakkan View Post
    A minor bug, for the period 1/1/1900 - 2/29/1900 shows a day prior.

    eg:

    1/1/1900 & 2/29/1900, shows "Thirty-first of December, One Thousand Eight Hundred Ninety-Nine" & "Twenty-eighth of February, One Thousand Nine Hundred" respectively.
    Actually, there is no bug in my code (if you call the function from within other VB code, you will see it works correctly). There is a bug at work here though, but it is in Excel, not my code. Excel thinks that the year 1900 was a leap year meaning Excel thinks there was a February 29, 1900 when in reality there was no such date, my code (which does know 1900 was not a leap year) ends up reporting a day earlier for January and February 1900. Given this problem exists only for a set of dates that next to nobody will ever seek to display as words, I am not sure it is worth trying to fix... I think about trying to fix it though (not as straightforward a task as it might seem). Anyway, see here for the reason behind this Excel bug...

    Excel 2000 incorrectly assumes that the year 1900 is a leap year

    Quote Originally Posted by Haseeb Avarakkan View Post
    Based on your logic, I think we could also use it by native formulas, with help of 2 lookup tables.
    That seems to work... nicely done! My preference is still for the UDF... less overhead in Excel "real estate" (meaning it is easily reusable in multiple workbooks) plus it can be called by other VB code where it can cover dates earlier than 1/1/1900 if desired.
    Last edited by Rick Rothstein; 02-25-2012 at 01:47 PM.

Similar Threads

  1. Number to Words (Rupees)
    By vishwajeet_chakravorty in forum Excel Help
    Replies: 8
    Last Post: 02-24-2014, 09:26 PM
  2. Replies: 5
    Last Post: 06-15-2013, 12:40 PM
  3. Replace Incorrect Date In Cell To Another Valid Date
    By DARSHANKmandya in forum Excel and VBA Tips and Tricks
    Replies: 2
    Last Post: 03-21-2013, 09:27 PM
  4. Spell a Date out in Words
    By Rick Rothstein in forum Rick Rothstein's Corner
    Replies: 6
    Last Post: 04-08-2012, 12:19 PM
  5. Number to Words (Rupees)
    By sa.1985 in forum Excel Help
    Replies: 2
    Last Post: 12-16-2011, 08:57 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •