[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

vba to exclude Saturday and Sunday from date calculation

Posted on 2012-03-28
2
Medium Priority
?
371 Views
Last Modified: 2012-06-21
I have a spreadsheet where I need to calculate the number of minutes between to time fields and to include weekdays in the calculation IF the oldest time in the queue is a day prior to the current day.   How would I do this? the formula is in ( i12).  columns g & H are hidden I have  attached a sample of the spreadsheet

Thank You
2012-Research-Queue-Checkpoint.xls
0
Comment
Question by:eyes59
  • 2
2 Comments
 
LVL 81

Accepted Solution

by:
byundt earned 2000 total points
ID: 37779679
The NETWORKDAYS function returns the number of weekdays between two dates. If both dates are the same, it returns 1. So neglecting any correction for starting time, you might use:
=IF(H12="","",(NETWORKDAYS(B12,E12)-1+H12-C12)*1440)

The above formula is probably not sophisticated enough for your real problem. Among other things, it can't return a negative number. And it ignores your special handling for Mondays. But if you can give some sample data and expected results, I can fine-tune the formula to suit.

As an added bonus, NETWORKDAYS can exclude a list of holidays that you choose from the calculation. That feature may or may not come into play for your real situation--but for many problems it does.
0
 
LVL 81

Expert Comment

by:byundt
ID: 37781490
eyes59,
Please continue to post in this thread if you need help with implementation. Doing so adds value to the question in the Experts Exchange database.

Brad
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question