Combine TEXT function with the YEAR and MONTH function

jski21

Board Regular
Joined
Jan 2, 2019
Messages
133
Office Version
  1. 2016
Platform
  1. Windows
Hi Excelers,

Is there a process to combine the TEXT function with the YEAR and MONTH function? I'm using this formula to calculate the fiscal year:

=YEAR(A1)-(MONTH(A1)<J35)

It works just fine. The result however, displays the date as 1905 because Cell A1 is =TODAY() and I believe I need to precede the formula above in a TEXT function to get it to display properly? Cell J35 is simply the start month of the fiscal year (June).

As always, thanks for your review, consideration, and help.


jski
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
I find your question a little confusing.
Subtracting month from the year does not seem to make much sense to me.
Can you show us exactly what you want the expected result to look like?
 
Upvote 0
What result are you trying to get? Are you trying to get the period for something? or the month....please elaborate
Perhaps you just need to FORMAT the cell differently?
 
Last edited:
Upvote 0
In Column A I have the dates: 6/1/22, 7/1/22 through 5/1/23; in Cell E1 I have the following formula:
Excel Formula:
=YEAR(A1)&"-"&TEXT(IF(MONTH(A1)<6,MONTH(A1)+7,MONTH(A1)-5),"00")
which will give you YYYY-PP -4 digit year followed by a '-' followed by the number of the Period.
Rich (BB code):

		
		
	


	
1645113794764.png
 
Upvote 0
Thanks Joe4. Sure:

PR 05 - Drawdown Report by Project and Activity.xlsx
GHIJKLM
32Current:Desired:
33February 17, 2022February 17, 2022
34
35Budget Plan YearJuly 19056Budget Plan YearJune 2021
Pivot
Cell Formulas
RangeFormula
I33,M33I33=TODAY()
I35I35=YEAR(I33)-(MONTH(I33)<J35)


Is this helpful?
 
Upvote 0
Try using this formula, and format the resulting cell with the date format "mmmm-yyyy":
Excel Formula:
=IF(MONTH(I33)<J35,DATE(YEAR(I33)-1,6,1),DATE(YEAR(I33),6,1))
 
Upvote 0
Solution
Both of these solutions worked. Joe4's seems to fit the best in the context of what I'm trying to do. Thanks everyone.
 
Upvote 0
You are welcome.
Glad we could help!
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,551
Members
449,088
Latest member
davidcom

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