โ02-10-2022 01:08 PM
How to get which quarter from the date format 2022-01-31
Is there any formula to get, quarters ( Q1, Q2, Q3,Q4) from the date
โ02-10-2022 03:11 PM
Just takes a little programming trick.. you can do the same in Excel as well.. you first extract the month from the date, then divide the month by 3 and round it up. To do this in Ruby, you use the Ceiling command.. here is an example that takes "now" (the current date and time) and converts it into the current quarter for "now":
=(now.month / 3.0).ceil
โ02-11-2022 05:03 AM
(2022-01-31).strftime("%m") from this you will get which month it is and divide it by 3 to get which quarter.