I need an array with the numbers for the months in the current quarter. I want to supply Date.today
and then get eg. [1,2,3]
.
How do I do that in the easiest way? (Not by using switch
/case
).
Find and get quarter from date by formula Select a blank cell which next to the date, here I select C1, and type this formula =ROUNDUP(MONTH(A1)/3,0) into it, then press Enter key to get the relative quarter.
def quarter(date)
1 + ((date.month-1)/3).to_i
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With