Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default DateDifference Question

I want to compare two cells containing dates (beginning and ending) and
return the number of months difference -
the purpose is to use this figure for computing annual turnover.
I can't seem to get DateDiff calculation that works in Access to work in
Excel
Help please

DateDiff("m",start, end)


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default DateDifference Question

Your code should work in VBA the same way. E.g.,

Debug.Print DateDiff("m", #1/1/2004#, Now)


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Junior" wrote in message
...
I want to compare two cells containing dates (beginning and

ending) and
return the number of months difference -
the purpose is to use this figure for computing annual

turnover.
I can't seem to get DateDiff calculation that works in Access

to work in
Excel
Help please

DateDiff("m",start, end)




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default DateDifference Question

Thanks chip - figured it out - function is a little different and reversed
in excel....

DateDif (start date, end date, "m")

"Chip Pearson" wrote in message
...
Your code should work in VBA the same way. E.g.,

Debug.Print DateDiff("m", #1/1/2004#, Now)


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Junior" wrote in message
...
I want to compare two cells containing dates (beginning and

ending) and
return the number of months difference -
the purpose is to use this figure for computing annual

turnover.
I can't seem to get DateDiff calculation that works in Access

to work in
Excel
Help please

DateDiff("m",start, end)






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 244
Default DateDifference Question

use DateAdd function to accomplish your task (it does subtractions too)
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007 Macro/VB Question DDE Question MadDog22 Excel Worksheet Functions 1 March 10th 10 01:47 AM
where can I see my question and answer? Yesterday I ask a question IP Excel Discussion (Misc queries) 2 May 10th 08 04:08 PM
Newbie Question - Subtraction Formula Question [email protected] Excel Discussion (Misc queries) 3 May 5th 06 05:50 PM
The question is an excel question that I need to figure out howto do in excel. Terry Excel Worksheet Functions 3 January 23rd 06 06:22 PM
Another question for Jon Wazooli Charts and Charting in Excel 1 March 26th 05 06:57 AM


All times are GMT +1. The time now is 12:01 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"