IF statements with dates and condition

Lilly13m

New Member
Joined
Jan 26, 2021
Messages
4
Office Version
  1. 365
Platform
  1. Windows
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
Joined
Apr 28, 2004
Messages
76,303
Office Version
  1. 365
Platform
  1. Windows
Try this.
Code:
=IF(A2="", "", (DATE(YEAR(A2), 12, 31)-A2)/365)
 

Lilly13m

New Member
Joined
Jan 26, 2021
Messages
4
Office Version
  1. 365
Platform
  1. Windows
I wrote this
IFS

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

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,303
Office Version
  1. 365
Platform
  1. Windows
Oops, didn't do the blank cell part correctly.

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

Forum statistics

Threads
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.
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
Top