Networkdays Result

kumara_faith

Well-known Member
Joined
Aug 19, 2006
Messages
611
Hi,

I have the following table:

Excel Workbook
BCDEF
2M1M2M3*Desired Result
307/19/1007/25/1007/25/10*5
406/27/1007/01/1007/02/10*4
506/28/10*07/05/10*5
607/13/1007/21/1007/20/10*5
Sheet1




I need to build a formula in column F for the following criteria:

1) If M2 is same as M3, then use networkdays to calculate the difference of days from M1 to M3. ( M1 is the start date and M3 is the end date)
2) If M2 is less than M3, then deduct 1 day from the result of networkdays from M1 to M3.( M1 is the start date and M3 is the end date)
3) If M2 is empty, then use networkdays to calculate the difference of days from M1 to M3. ( M1 is the start date and M3 is the end date)
4) If M2 is more than M3, then use networkdays to calculate the difference of days from M1 to M3. ( M1 is the start date and M3 is the end date)

The desired result is stated in column F.

Appreciate assistance.
 

Some videos you may like

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

prabby25101981

Active Member
Joined
Jul 28, 2010
Messages
348
Considering that the outcome of condition 1, 2, and 4 is the same, here's the formula -

=IF(OR(B3>=C3,ISBLANK(B3)),NETWORKDAYS(A3,C3),NETWORKDAYS(A3,C3)-1)

Does this help ?
 

kumara_faith

Well-known Member
Joined
Aug 19, 2006
Messages
611
barry / prabby,

Thank you both for the suggested solutions. Both worked !

Appreciate your valuable time, effort and patience !
 

Subscribe on YouTube

Watch MrExcel Video

Forum statistics

Threads
1,106,818
Messages
5,513,563
Members
408,959
Latest member
BenBez

This Week's Hot Topics

  • Sort code advice please
    Hi, I have the code below which im trying to edit but getting a little stuck. This was the original code which worked fine,columns A-F would sort...
  • SUMPRODUCT with nested If statement
    Hi everyone, Hope you're all well. I'm hoping someone will be able to point me in the right direction with a problem I'm having with a SUMPRODUCT...
  • VBA - simple sort is killing me!
    Hello all! This should be so easy, but not for me, apparently! I have a table of data that can be of varying lengths and widths. My current macro...
  • Compare Two Lists
    I have two Lists and I need to be able to Identify differences between them. List 100 comes from a workbook - the other is downloaded form the...
  • Formula that deducts points for each code I input.
    I am trying to create a formula that will have each student in my class start at 100 points and then for each code that I enter (PP for Poor...
  • Conditional formatting formula required for day of week and a value
    Hi, I have a really simple spreadsheet where column A is the date, column B is the activity total shown as a number and column C states the day of...
Top