If statement returning a 0 when cell is blank

Bexcel11

New Member
Joined
May 10, 2019
Messages
5
Hi Guys,
In Cell T7 I am trying to calculate the number of weeks between two dates, L7-K7 unless there is no date in L7 there for it will calculate from AB1 where I have a formula =Today().
Currently the formula I have in T7 is below:
=IF(L7=“”,$AB$1-K7,L7-K7)/7
This works perfectly, my problem is that in some case both L7 and K7 dates maybe be unknown and therefore blank, in this case I need T7 to return 0 and/or ignore the formula until said dates are put in.
T7 is currently returning 6228.
Please help.
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Try using

Code:
=IF(AND(L7="",K7=""),"",IF(L7="",$AB$1-K7,L7-K7)/7)
 
Upvote 0
You my friend, are a legend! That has fixed my issue!! Thank you so much it’s been driving me crazy!!
 
Upvote 0
Glad to help....thx for the feedback..:beerchug:
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,323
Members
452,635
Latest member
laura12345

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