# IF statements with dates and condition

#### Lilly13m

##### New Member
Example

I have lease start date of nov 1/2020 and need to have the calculation in percentage of how much until the end of year ..

Nov1-dec 31 =60 days out of 365 = 16.43%

IF STATEMENT

So if column "a" end date is blank then percentage is 100%
If column "a"has a date, ( ie 11/01/2020) then calculate The percentage .. to 12/31/2020 . which should come out to 16.43%

### Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.

#### Norie

##### Well-known Member
Try this.
Code:
``=IF(A2="", "", (DATE(YEAR(A2), 12, 31)-A2)/365)``

#### Lilly13m

##### New Member
Try this.
Code:
``=IF(A2="", "", (DATE(YEAR(A2), 12, 31)-A2)/365)``

#### Lilly13m

##### New Member
I wrote this
IFS

Logical test1 is blank (a2)
Value if true "100"
Logical test. 2 ... which do I insert

#### Norie

##### Well-known Member
Oops, didn't do the blank cell part correctly.

It should be this.
Code:
``=IF(A2="", 1, (DATE(YEAR(A2), 12, 31)-A2)/365)``

#### Lilly13m

##### New Member
I wrote this
IFS

Logical test1 is blank (a2)
Value if true "100"
Logical test. 2 ... which do I insert
Thanks tried something else and it worked

Replies
3
Views
69
Replies
3
Views
68
Replies
1
Views
62
Replies
0
Views
40
Replies
7
Views
81

1,141,069
Messages
5,704,111
Members
421,327
Latest member
Msh

### 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.

### Which adblocker are you using?

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

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