Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-10-2025, 05:56 AM
SnakeDoctor's Avatar
SnakeDoctor SnakeDoctor is offline Need to calculate difference between 2 dates, sans W/E and holidays, with result in months and days Windows 11 Need to calculate difference between 2 dates, sans W/E and holidays, with result in months and days Office 2021
Advanced Beginner
Need to calculate difference between 2 dates, sans W/E and holidays, with result in months and days
 
Join Date: Jul 2023
Location: Ft. Worth, TX
Posts: 38
SnakeDoctor is on a distinguished road
Default Need to calculate difference between 2 dates, sans W/E and holidays, with result in months and days

I am developing a Project Tracking Workbook and need to calculate the difference between START DATE (Col N) and END DATE (Col P) as the TOTAL PRODUCTION TIME (Col R) in months and days.



I have tried two formulas, as follows:

=IF($N10<>"",IFERROR(DATEDIF($N10,$P10,"ym")&" months "&DATEDIF($N10,$P10,"md")+1&" days", "No 'End Date' Entered"),"")

This one works, but does not remove W/Es or holidays. It is in cells R4 and R5 of the attached screenshot.

=IF($N12<>"",IFERROR(NETWORKDAYS($N12,$P12,M116:M1 23)&" months "&NETWORKDAYS($N12,$P12,M116:M123)&" days", "No 'End Date' Entered"),"")

This is my poor attempt to incorporate NETWORKDAYS, which kind of works but returns only the number of days in both counts. It is in cell R6 of the attached screenshot.

I have tried several methods to convert the (first) calculation result into months with no luck.

Any suggestions?
Attached Images
File Type: jpg screenshot.jpg (77.6 KB, 13 views)
Reply With Quote
  #2  
Old 04-10-2025, 08:24 AM
Logit Logit is offline Need to calculate difference between 2 dates, sans W/E and holidays, with result in months and days Windows 10 Need to calculate difference between 2 dates, sans W/E and holidays, with result in months and days Office 2007
Expert
 
Join Date: Jan 2017
Posts: 587
Logit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the rough
Default

Code:
=INT(NETWORKDAYS(A1, B1)/30) & " months, " & MOD(NETWORKDAYS(A1, B1), 30) & " days"
Edit specific cells as required.
Reply With Quote
  #3  
Old 04-10-2025, 08:40 AM
SnakeDoctor's Avatar
SnakeDoctor SnakeDoctor is offline Need to calculate difference between 2 dates, sans W/E and holidays, with result in months and days Windows 11 Need to calculate difference between 2 dates, sans W/E and holidays, with result in months and days Office 2021
Advanced Beginner
Need to calculate difference between 2 dates, sans W/E and holidays, with result in months and days
 
Join Date: Jul 2023
Location: Ft. Worth, TX
Posts: 38
SnakeDoctor is on a distinguished road
Default

Logit,

OMG! That is PERFECT. A simple, elegant solution to chaos I lost myself in chasing through my inexperience in Excel.

THANK YOU VERY MUCH for throwing this lifeline.
Reply With Quote
  #4  
Old 04-10-2025, 08:43 AM
Logit Logit is offline Need to calculate difference between 2 dates, sans W/E and holidays, with result in months and days Windows 10 Need to calculate difference between 2 dates, sans W/E and holidays, with result in months and days Office 2007
Expert
 
Join Date: Jan 2017
Posts: 587
Logit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the rough
Default

You are welcome.
Reply With Quote
  #5  
Old 04-11-2025, 11:35 PM
ArviLaanemets ArviLaanemets is offline Need to calculate difference between 2 dates, sans W/E and holidays, with result in months and days Windows 8 Need to calculate difference between 2 dates, sans W/E and holidays, with result in months and days Office 2016
Expert
 
Join Date: May 2017
Posts: 932
ArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant future
Default

Let's assume the start date is 28.02.2025, and the end date is 29.03.2025. Is the time interval 0 months and 29 days, or 1 month and 1 day?

When you want approximate number of months and days, the Logit's solution is OK!
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Default How to automatically Calculate number of days between two dates? wcngu1 Word 6 10-24-2019 04:20 AM
Pivot table- % growth and difference between two items in same column by months sarana Excel 2 01-28-2019 06:42 AM
Need to calculate difference between 2 dates, sans W/E and holidays, with result in months and days Calculating Quarterly Dates by Months not Days Artboy34 Excel 3 01-28-2016 09:47 AM
set daily goal for actual workdays, excluding weekends holidays and days off Brian Reilly Excel 1 01-24-2014 11:56 PM
Need to calculate difference between 2 dates, sans W/E and holidays, with result in months and days Calculate difference by days and hours alysolyman Excel 6 05-13-2013 02:19 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:44 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft