Formula help

bailbonds

Board Regular
Joined
Mar 19, 2010
Messages
70
Hi,

I have 3 cells

W5 = a date
X5 = a date
Y5 = will be a calc to show either W5 or X5 minus todays date

My stipulations are -

If W5 and X5 are blank then Y5 must be blank
If W5 and X5 have a value then Y5 must be the calc showing X5 minus today's date
If X5 is blank but W5 has a value then Y5 must be the calc showing W5 minus today's date

I can get so far but I can't get it to do the calc if W5 and X5 have a value.

My formula so far is -

=IF(AND(W5="",X5=""),"",IF(X5="",NETWORKDAYS(Sheet2!B1,W5,0),IF(W5="",NETWORKDAYS(Sheet2!B1,X5,0),"")))

Where 'Sheet2!B1' is the cell that references today's date.

Any ideas?

Thanks in advance.
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
How about...

Put this in Y5

=IF(AND(W5="",X5=""),"",IF(AND(W5<>"",X5<>""),X5-TODAY(),IF(AND(X5="",W5<>""),W5-TODAY())))
 
Upvote 0
=IF(AND(W5="",X5=""),"",IF(X5="",NETWORKDAYS(Sheet2!B1,W5,0),IF(W5="",NETWORKDAYS(Sheet2!B1,X5,0),NETWORKDAYS(Sheet2!B1,X5,0))))
TRY?
 
Upvote 0
Hi ,

You can try this

=IF(AND(W5="",X5=""),"",IF(W5<>"",IF(X5<>"",NETWORKDAYS(X5,TODAY()),NETWORKDAYS(W5,TODAY())),IF(X5="","",NETWORKDAYS(X5,TODAY()))))
 
Upvote 0
Cheers guys.

I've tried both and messed about a bit but they both return True or False numbers.

I then made a minor tweak to my original one by changing it to -

=IF(AND(W5="",X5=""),"",IF(X5="",NETWORKDAYS(Sheet2!B1,W5,0),IF(W5>1,NETWORKDAYS(Sheet2!B1,X5,0),"")))

I thought this originally worked but am now getting True or False returns on this.

Any ideas why?
 
Upvote 0

Forum statistics

Threads
1,219,161
Messages
6,146,657
Members
450,706
Latest member
LGVBPP

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