Search code examples
libreofficelibreoffice-calclibreoffice-basic

Convert from date to quarter


I have the A1 field with the date in the following format: 2020-01-30

Need to know the quarter of the date, in my case it should be 1. Please hint how to do this with the function, thank you.


Solution

  • Just extract the month number from the date and divide by 3, round the result:

    =INT((MONTH(A1)+2)/3)