Search

Friday, November 11, 2011

Quarter Calculation

Infopath Field Function to Calculate the "Quarter" based on a previously entered date
  1. Create a Field named "Date"
  2. Create a Rule on the "Date" field
  3. Enter this formula as the Value for the Rule: floor(((number(substring(., 6, 2)) + 11) / 3) mod 4) + 1
  4. Set Condition to "None - This rule always applies"
  5. Create a field named "Quarter"
  6. Set the "Quarter" field's Data Type to: "Whole Number (Integer)"


Tuesday, April 19, 2011

Excel - Current Quarter Calc

Excel Formula to Calculate the Current Quarter

=IF(LEN(B2) > 0,VLOOKUP(MONTH(B2),{1,"Q1";4,"Q2";7,"Q3";10,"Q4"},2),"") & IF(LEN(B2)>0,IF(OR(MONTH(B2)=1,MONTH(B2)=2)," '" & RIGHT(YEAR(B2),2)," '" & RIGHT(YEAR(B2),2)),"")