While I respect your right to do so, your donations and the minimal advertisements on this site help to defray internet and other costs of providing this content. Please consider excluding this website from blocking or turning off the blocker while browsing this site. The information, illustrations and code contained in my "Microsoft Word Tips" are provided free and without risk or obligation.
However, the work is mine. If you use it for commercial purposes or benefit from my efforts through income earned or time saved then a donation, however small, will help to ensure the continued availability of this resource. If you would like to donate, please use the appropriate donate button to access PayPal. Thank you! For example, the document author may wish to calculate and include a date 30, 60, or 90 days advanced from a date of sale. Several Word MVPs colleagues have addressed this topic in newsgroups responses or through their personal websites.
Friend and MVP Graham Mayor explains in his website why adding a number to a date value in a simple calculation field provides disappointing results.
He also introduces his visitors via link and examples to a brilliant collection of methods for performing calculations, including date calculations. These calculations are performed using Word fields that were perfected and made available to the general public by MVP Paul Edstein, aka "Macropod," a long time contributor in Word support forums.
Be sure to download DateCal. Let's start with the example given above. You want to calculate and enter , , and day payment due dates. First, the fields. In the first illustration below, the shaded areas are text-generated, using Word fields. The second illustration is the same sample text with the field codes displayed. While Word allows you to do simple calculations using numeric values in fields, it does not allow you to perform such calculations using dates instead of numbers.
You can, however, pull dates apart into their intrinsic portions months, days, and years , and then do your calculations, but this introduces a whole set of new problems. All of a sudden you need to be concerned with what happens when you "roll" past the end of a month or year. The math involved in doing such a calculation is not trivial.
As an example, consider the following compound field:. This will return the date in two weeks time specified in the first line where the Delay value is set. The drawback, of course, is the compound nature of the field—there are over 30 different fields just within this compound field!
Even this implementation, as formidable as it looks, will not handle leap years correctly in all instances. It won't handle leap years correctly in century years divisible by Is there an easy way to calculate future dates?
Yes, there is—simply use macros. With just a couple of simple instructions you can make short work out of otherwise difficult date calculations. WordTips is your source for cost-effective Microsoft Word training. Microsoft Word is the most popular word processing software in the world. This tip applies to Microsoft Word , , , , , and Word in Office You can find a version of this tip for the older menu interface of Word here: Calculating Dates with Fields. With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author.
He is president of Sharon Parq Associates , a computer and publishing services company. Learn more about Allen Create a table and Word figures out column widths by dividing the horizontal space by the number of columns you want in It is no secret that Excel allows you to work with dates in your worksheets.
Getting your information into a format that I'm trying to create a document for work that is a checklist of tasks that need to be completed by a certain date based on when our clients are going live. So I want to put a date in a field on a table and have it automatically calculate that date minus 90 days for one, then date minus 65 for the next etc.
It looks like I will be forced to use VBA to be able to do that, but I was wanting to check before I ventured into that side if there was a way to do this through formulas or something a touch easier. I know this would be super easy to do in Excel, but we need to present this to our clients so I was hoping to do it in Word to have it be a touch prettier.
In my searching I have found easier ways to do it inside of Access or Sharepoint as well, but those both involve putting another column in a table to help it calculate and I can't seem to find a way to hid columns in Word. Nor do I know if those formulas will translate to Word. I thank you all for your time and consideration on this.
I have found a macro that functions similar to how I want, but I need it to take a date we input to calculate the difference instead of the system date. I'm sorry that I stepped away from the forum for a day and missed the progress, or lack of it, in this thread. I think I can make up for it. First, as Charles was saying, you may need to run a macro to change some of the field arrangements in the tutorial. Changing the order shouldn't be necessary for systems using day-month-year settings; for those using month-day-year settings, it's a once-only change.
For your other issue, seeing only the result when you paste the copied field, that's a few paragraphs earlier on the same page:. An ASK field in the first row of the table lets you enter the base date the one from which the other dates are calculated. Each of the other rows contains the same calculation field but with a different delay number of days before the base date.
I've modified the tutorial's field to take the base date, instead of using the DATE function which always gives the current system date.
0コメント