amarbalani
New Member
- Joined
- Dec 4, 2017
- Messages
- 1
I currently havedates (calendar year) that are in 6 different formats and want to convert allthe different formats into quarters, within one formula
[TABLE="width: 1"]
<tbody>[TR]
[TD] Format[/TD]
[TD] Example[/TD]
[TD] Expected output (Quarter) [/TD]
[TD] Notes[/TD]
[/TR]
[TR]
[TD] DD/MM/YYYY[/TD]
[TD] 12/01/2017[/TD]
[TD] 4Q 2017[/TD]
[TD][/TD]
[/TR]
[TR]
[TD] MM/YYYY[/TD]
[TD] 12/2017[/TD]
[TD] 4Q 2017 [/TD]
[TD][/TD]
[/TR]
[TR]
[TD] XH YYYY[/TD]
[TD] 1H 2017
2H 2017 [/TD]
[TD] 1Q 2017
3Q 2017 [/TD]
[TD]
[/TR]
[TR]
[TD] YYYY[/TD]
[TD] 2017[/TD]
[TD] 1Q 2017 [/TD]
[TD] If standalone year default to 1Q YYYY[/TD]
[/TR]
[TR]
[TD] XQ YYYY[/TD]
[TD] 4Q 2017[/TD]
[TD] 4Q 2017 [/TD]
[TD][/TD]
[/TR]
[TR]
[TD] YYYY-YYYY[/TD]
[TD]
[TD] 1Q 2018 [/TD]
[TD] IF a range of years , default to 1Q of the first year in range[/TD]
[/TR]
</tbody>[/TABLE]
Actual data from Column D in worksheet:
[TABLE="width: 214"]
<tbody>[TR]
[TD]11/26/2018[/TD]
[/TR]
[TR]
[TD]12/15/2018[/TD]
[/TR]
[TR]
[TD]12/27/2018[/TD]
[/TR]
[TR]
[TD]4Q 2018[/TD]
[/TR]
[TR]
[TD]4Q 2018[/TD]
[/TR]
[TR]
[TD]2H 2018[/TD]
[/TR]
[TR]
[TD]2H 2018[/TD]
[/TR]
[TR]
[TD]2018[/TD]
[/TR]
[TR]
[TD]2018[/TD]
[/TR]
[TR]
[TD]2018[/TD]
[/TR]
[TR]
[TD]2018[/TD]
[/TR]
[TR]
[TD]2018[/TD]
[/TR]
[TR]
[TD]2018[/TD]
[/TR]
[TR]
[TD]2018[/TD]
[/TR]
[TR]
[TD]2018-2019[/TD]
[/TR]
[TR]
[TD]2018-2019[/TD]
[/TR]
[TR]
[TD]2018-2019[/TD]
[/TR]
[TR]
[TD]2018-2019[/TD]
[/TR]
[TR]
[TD]2018-2019[/TD]
[/TR]
[TR]
[TD]2018-2019[/TD]
[/TR]
[TR]
[TD]2018-2019[/TD]
[/TR]
[TR]
[TD]2018-2019[/TD]
[/TR]
[TR]
[TD]2018-2020[/TD]
[/TR]
[TR]
[TD]2018-2020[/TD]
[/TR]
[TR]
[TD]2018-2021[/TD]
[/TR]
[TR]
[TD]2018-2022[/TD]
[/TR]
[TR]
[TD]01/01/2019[/TD]
[/TR]
[TR]
[TD]01/03/2019[/TD]
[/TR]
[TR]
[TD]01/22/2019[/TD]
[/TR]
[TR]
[TD]02/17/2019[/TD]
[/TR]
[TR]
[TD]02/18/2019[/TD]
[/TR]
[TR]
[TD]02/27/2019[/TD]
[/TR]
[TR]
[TD]02/2019[/TD]
[/TR]
[TR]
[TD]02/2019[/TD]
[/TR]
[TR]
[TD]02/2019[/TD]
[/TR]
[TR]
[TD]03/04/2019[/TD]
[/TR]
</tbody>[/TABLE]
Is there a singleformula that can be used to take the different "formats" from thetable above and can be used to convert to the "Expected Output(Quarter)", as outlined in the table above ?
Thank you
[TABLE="width: 1"]
<tbody>[TR]
[TD] Format[/TD]
[TD] Example[/TD]
[TD] Expected output (Quarter) [/TD]
[TD] Notes[/TD]
[/TR]
[TR]
[TD] DD/MM/YYYY[/TD]
[TD] 12/01/2017[/TD]
[TD] 4Q 2017[/TD]
[TD][/TD]
[/TR]
[TR]
[TD] MM/YYYY[/TD]
[TD] 12/2017[/TD]
[TD] 4Q 2017 [/TD]
[TD][/TD]
[/TR]
[TR]
[TD] XH YYYY[/TD]
[TD] 1H 2017
2H 2017 [/TD]
[TD] 1Q 2017
3Q 2017 [/TD]
[TD]
- Want anything with "1H YYYY" to be 1Q YYYY
- Want anything with "2H YYYY" to be 3Q YYYYY
[/TR]
[TR]
[TD] YYYY[/TD]
[TD] 2017[/TD]
[TD] 1Q 2017 [/TD]
[TD] If standalone year default to 1Q YYYY[/TD]
[/TR]
[TR]
[TD] XQ YYYY[/TD]
[TD] 4Q 2017[/TD]
[TD] 4Q 2017 [/TD]
[TD][/TD]
[/TR]
[TR]
[TD] YYYY-YYYY[/TD]
[TD]
- 2022
[TD] 1Q 2018 [/TD]
[TD] IF a range of years , default to 1Q of the first year in range[/TD]
[/TR]
</tbody>[/TABLE]
Actual data from Column D in worksheet:
[TABLE="width: 214"]
<tbody>[TR]
[TD]11/26/2018[/TD]
[/TR]
[TR]
[TD]12/15/2018[/TD]
[/TR]
[TR]
[TD]12/27/2018[/TD]
[/TR]
[TR]
[TD]4Q 2018[/TD]
[/TR]
[TR]
[TD]4Q 2018[/TD]
[/TR]
[TR]
[TD]2H 2018[/TD]
[/TR]
[TR]
[TD]2H 2018[/TD]
[/TR]
[TR]
[TD]2018[/TD]
[/TR]
[TR]
[TD]2018[/TD]
[/TR]
[TR]
[TD]2018[/TD]
[/TR]
[TR]
[TD]2018[/TD]
[/TR]
[TR]
[TD]2018[/TD]
[/TR]
[TR]
[TD]2018[/TD]
[/TR]
[TR]
[TD]2018[/TD]
[/TR]
[TR]
[TD]2018-2019[/TD]
[/TR]
[TR]
[TD]2018-2019[/TD]
[/TR]
[TR]
[TD]2018-2019[/TD]
[/TR]
[TR]
[TD]2018-2019[/TD]
[/TR]
[TR]
[TD]2018-2019[/TD]
[/TR]
[TR]
[TD]2018-2019[/TD]
[/TR]
[TR]
[TD]2018-2019[/TD]
[/TR]
[TR]
[TD]2018-2019[/TD]
[/TR]
[TR]
[TD]2018-2020[/TD]
[/TR]
[TR]
[TD]2018-2020[/TD]
[/TR]
[TR]
[TD]2018-2021[/TD]
[/TR]
[TR]
[TD]2018-2022[/TD]
[/TR]
[TR]
[TD]01/01/2019[/TD]
[/TR]
[TR]
[TD]01/03/2019[/TD]
[/TR]
[TR]
[TD]01/22/2019[/TD]
[/TR]
[TR]
[TD]02/17/2019[/TD]
[/TR]
[TR]
[TD]02/18/2019[/TD]
[/TR]
[TR]
[TD]02/27/2019[/TD]
[/TR]
[TR]
[TD]02/2019[/TD]
[/TR]
[TR]
[TD]02/2019[/TD]
[/TR]
[TR]
[TD]02/2019[/TD]
[/TR]
[TR]
[TD]03/04/2019[/TD]
[/TR]
</tbody>[/TABLE]
Is there a singleformula that can be used to take the different "formats" from thetable above and can be used to convert to the "Expected Output(Quarter)", as outlined in the table above ?
Thank you