» Avoiding Negative Values when Calculating the Number of Days between Two Dates
CATEGORY - Excel Date & Time Formulas
VERSION - All Microsoft Excel Versions
We want to create a formula to calculate the number of days between each pair of dates in columns A & B, but the formula is never to return a negative value.
Empty cells in column A are to be considered the first day of the year, and empty cells in column B are to be considered the last day of the year.
Solution:
Use the MAX, MIN, and DATE functions as shown in the following formula:
=MIN(B2,DATE(2005,12,31))-MAX(A2,DATE(2005,1,1))
Book Store:
Recommended Books:
- The Interpretation of Financial Statements
- Financial Statement Analysis: A Practitioner's Guide, 3rd Edition
- Financial Statements: A Step-By-Step Guide to Understanding and Creating Financial Reports
- Successful Business Planning in 30 Days: A Step-By-Step Guide for Writing a Business Plan and Starting Your Own Business
- Special Edition Using Microsoft Outlook 2002
- Final Accounting: Ambition, Greed and the Fall of Arthur Andersen
No comments have been submitted.

