• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Multiplying/Dividing dates

PipBoy808

Member
Could someone explain to me how multiplying/dividing dates in Excel works?

For instance, taking today's date:

(11 November 2013) / 7 = 6 April 1916

What exactly is Excel doing to return this result?
 
Good day PipBoy808

The first date you are using is, (11 November 2013) which in excel world is 41589.00 and divided by 7 gives you 5941.29 which is 6 April 1916, Excel has done it this way because it does not understand why anybody would want to divide a date and has turned the dates in to their corresponding number to try and do what, for reasons it does not understand, you want to do.

It does not help to have parentheses around the date.
 
Why do you want to multiply or divide dates? There's no logical operation or process that involves that.

It was written in some VBA I was looking at. I just wanted to understand what was going on. Thanks!
 
Hi, PipBoy808!
Be kind and do all us a favour... change your reading sources, or just switch to these website forums (but in this case please avoid my posts, instead I strongly recommend you those of b(ut)ob(ut)hc but after five o'clock British ceremony, which in his case it's called Carlsberg, malt, etc.).
Regards!
 
Good evening SirJB7 how are you my friend.

After trying to divide the 11/11/2013 by 7(seconds! minutes!, hours!, days!, weeks!, Years!, who knows what seven could even be seven of nine (very nice lady)) I will be having a malt or two to let the grey cells be assimilated by the gold water of life from Scotland.
 
if you divide a date by 7, you get the number of weeks since 1/1/1900, which could be what the VBA author was attempting. (Not sure regarding the rationale, etc.!)

-Sajan.
 
Good day Sajan

I like you do not understand what the original VBA was trying to do 1916 is a lot of week's:p
 
Hi Bob,
I can only speculate, but the VBA author might have been trying to determine the number of elapsed days between two dates, and used the number of weeks since 1/1/1900 as the basis for that calculation (i.e. number of weeks divided by 52 to get years, then the number of years times 365 to determine days, etc.!).

Of course, there are many simpler approaches for calculating elapsed days, and as such, I am not sure why anyone would use such an approach. It could be that the VBA author did not want his "secrets" to be revealed to any casual reader of the code! Or, it could be that the VBA author did not know what he was doing. Either way, it adds to the enjoyment of those reading his code (which could have been his/her motive!)

Cheers,
Sajan.
 
Back
Top