Scroll

Custom Function: Fiscal Quarter

This function returns the Fiscal Quarter of the input date.

Arguments (Min - Max): 1 - 1

Usage

Quarter(x)

  • x is a Date, DateTime, or date string

Code

DateTime date = DateTime.Parse(args[0].ToString());
int month = date.Month; // range from 1 - 12

if (month >= 1 && month <= 3) // Jan - Mar
  return 1;

if (month >= 4 && month <= 6) // Apr - June
  return 2;

if (month >= 7 && month <= 9) // July - Sept
  return 3;

return 4; // Oct - Dec

Hidden Article Information

Article Author
Nick
created 2016-01-28 17:04:15 UTC
updated 2017-06-20 15:13:37 UTC

Labels
formulas, functions, custom, quarter,
Have more questions? Submit a request