Networkdays Formula IF/OR Cell has Open or Closed

EvanDef

New Member
Joined
Jan 6, 2014
Messages
21
Hello Excel Gurus!

I am befuddled over an IF/OR function in Column M (M2) of Networkdays where if Column L (L2) has "Closed" as a status Networkdays calculates the difference between J2(start date),K2(end date),HOLIDAYS in M2. But if Column L (L2) has "Open" as a status Networkdays calculates the difference between J2(start date),TODAY(end date),HOLIDAYS. Also, if Column L is marked as "Closed" but there is no date populated in the corresponding end date cell (K), ERROR should be returned to prompt data entry corrections.

[TABLE="width: 500"]
<tbody>[TR]
[TD]J - Start Date
[/TD]
[TD]K - End Date
[/TD]
[TD]L - Status
[/TD]
[TD]M - Bus Days
[/TD]
[/TR]
[TR]
[TD]10/26/13
[/TD]
[TD]12/3/13
[/TD]
[TD]Closed
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]11/21/13
[/TD]
[TD]1/9/14
[/TD]
[TD]Closed
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1/27/14
[/TD]
[TD][/TD]
[TD]Open
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2/21/14
[/TD]
[TD]3/27/14
[/TD]
[TD]Closed
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3/20/14
[/TD]
[TD][/TD]
[TD]Closed
[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


I appreciate your time, Thanks!
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Hi

How about somerthing like this:
=IF(L2="Open",NETWORKDAYS(J2,NOW()),IF(LEN(K2)=0,"ERROR",NETWORKDAYS(J2,K2)))

Amend the formula to suit your own holidays etc.

I trust this helps
Andrew
 
Upvote 0
Andrew,

That worked like a charm! I tried to nest my IF statements but I kept getting a negative value. I completely overlooked the character length (LEN) value and NOW function as options. Thanks for your direction.

Regards, Evan
 
Upvote 0

Forum statistics

Threads
1,226,729
Messages
6,192,696
Members
453,747
Latest member
tylerhyatt04

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top