Solved

Excel 2007/2010 function help

Posted on 2012-04-05
4
404 Views
Last Modified: 2012-04-05
To all excel gurus,
I need help with the current excel function:
=NETWORKDAYS($G4,$H4)+IF(NETWORKDAYS($G4,$H4)+ NETWORKDAYS($G4,$H4)=2,-SIGN(NETWORKDAYS($G4,$H4)),0)

This function works great to calculate the number of days between two dates.  How do I make it calculate 1 day if the date range is the same?
I have another simple calculation based upon the result.  

Please see the attached excel worksheet.

Any help will be greatly appreciated.
ExcelFunctionHelp.xlsx
0
Comment
Question by:BajanPaul
[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
4 Comments
 
LVL 42

Accepted Solution

by:
dlmille earned 500 total points
ID: 37814949
Use:

[B2]=IF($D2=$E2,1,NETWORKDAYS($D2,$E2)+IF(NETWORKDAYS($D2,$E2)+ NETWORKDAYS($D2,$E2)=2,-SIGN(NETWORKDAYS($D2,$E2)),0))

and copy down.

See attached.

Dave
ExcelFunctionHelp--1-.xlsx
0
 
LVL 42

Expert Comment

by:dlmille
ID: 37814952
However, what I don't understand is why you aren't just using:

[B2]=NETWORKDAYS($D2,$E2)

and copy down.

Please advise.

Dave
ExcelFunctionHelp-r2.xlsx
0
 

Author Closing Comment

by:BajanPaul
ID: 37814995
Solution as described.  Thanks for your help.
0
 

Author Comment

by:BajanPaul
ID: 37814996
Worked perfectly!
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

733 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