[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

vba to exclude Saturday and Sunday from date calculation

Posted on 2012-03-28
2
Medium Priority
?
368 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

649 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