ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   IF Formula (https://www.excelbanter.com/excel-worksheet-functions/165310-if-formula.html)

Matt

IF Formula
 
Take 2..

I am trying to get a formula that will assign a numeric value for a each
year past "TODAY". The TODAY date needs to change every day.

Today to 365days=1; 366 days to 730=2; 730 to 1095=3; 1095+ =4


Don Guillett

IF Formula
 
More info would have been helpful. Is this what you want.
=INT((TODAY()-H20)/365.25)

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Matt" wrote in message
...
Take 2..

I am trying to get a formula that will assign a numeric value for a each
year past "TODAY". The TODAY date needs to change every day.

Today to 365days=1; 366 days to 730=2; 730 to 1095=3; 1095+ =4



JE McGimpsey

IF Formula
 
One way:

If you're not concerned about leap years:

A1: <date

B1: =INT((A1-TODAY()-1)/365)+1

or if your max is really 4:

B1: =MIN(4, INT((A1-TODAY()-1)/365)+1)

If you want to take leap years into account:

B1: =DATEDIF(TODAY(),A1-1,"y")+1

In article ,
Matt wrote:

I am trying to get a formula that will assign a numeric value for a each
year past "TODAY". The TODAY date needs to change every day.

Today to 365days=1; 366 days to 730=2; 730 to 1095=3; 1095+ =4



All times are GMT +1. The time now is 10:04 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com