Categorize Data into Fiscal Year Based on Transaction Date

HotDogHippo

New Member
Joined
May 19, 2021
Messages
2
Office Version
  1. 365
Hello,

I have a list of financial data that spans 3 fiscal years.

Fiscal year 2018 - April 1, 2018 - March 31st, 2019
Fiscal Year 2019 - April 1, 2019 - March 31st, 2020
Fiscal Year 2020 - April 1, 2020 - March 31st, 2021

The transaction date (YYYYMMDD) is in Column Q and wondering if it's possible to have a formula in Column R to identify which fiscal year the transaction falls into based on the above categories.

I.E.

Q R
Date of Transaction Fiscal Year
20180403 20182

Any help would be much appreciated...
Thanks!

20180403​
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!

Toadstool

Well-known Member
Joined
Mar 5, 2018
Messages
2,194
Office Version
  1. 2016
Platform
  1. Windows
Hi HotDogHippo,

Does this work for you?

HotDogHippo.xlsx
QR
1DateFiscal Year
2201701012016
3201804032018
4201909092019
5202004012020
6202003312019
Sheet1
Cell Formulas
RangeFormula
R2:R6R2=IF(MID(Q2,5,2)+0<4,LEFT(Q2,4)-1,LEFT(Q2,4))+0
 

HotDogHippo

New Member
Joined
May 19, 2021
Messages
2
Office Version
  1. 365
Hi HotDogHippo,

Does this work for you?

HotDogHippo.xlsx
QR
1DateFiscal Year
2201701012016
3201804032018
4201909092019
5202004012020
6202003312019
Sheet1
Cell Formulas
RangeFormula
R2:R6R2=IF(MID(Q2,5,2)+0<4,LEFT(Q2,4)-1,LEFT(Q2,4))+0

Hi Toadstool,

Amazing....That does work...are you able to walk me through the logic of why it works?? Many thanks :)
 

Toadstool

Well-known Member
Joined
Mar 5, 2018
Messages
2,194
Office Version
  1. 2016
Platform
  1. Windows
Hi Toadstool,

Amazing....That does work...are you able to walk me through the logic of why it works?? Many thanks :)
You're welcome!
The +0 parts are to make sure the numbers are treated as numeric, not text.
MID(Q2,5,2) checks the date characters 5 and 6, the month. If the month is less than 4 (April) then the fiscal year is last year, so I take the first 4 characters (year) and subtract one.
If the month is 4 or higher then it's the same fiscal year as the date, so I take the first 4 characters and add zero to force numeric.
 

Forum statistics

Threads
1,148,140
Messages
5,745,035
Members
423,917
Latest member
Frank1931

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