Increment Year in IF statement

fengliangduck

New Member
Joined
Aug 1, 2022
Messages
2
Office Version
  1. 365
Hi,
I have a following IF statement and I totally enter 12 months manually 01-2022, 02-2022 ..... 12-2022. But, how to make year increment automatically. For example, IF "02-2022","02/28/2022". IF "02-2023","02/28/2023". IF "02-2024","02/28/2024". In short, I like to have this 202X and X will automatically change. Thank you !
=if(A1="02-2022","02/28/2022",If(A1="01-2022","01/31/2022,"0'))
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Rather than using an IF statement, perhaps try

=EOMONTH(A1,0)

That will return the last day of the month referenced in cell A1, regardless of year. Format the cell with the formula as a date, of course.
 
Upvote 0
Solution

Forum statistics

Threads
1,216,469
Messages
6,130,802
Members
449,595
Latest member
jhester2010

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