Forum Discussion

MMH11's avatar
MMH11
Copper Contributor
Feb 23, 2020

Grouping by dates in Excel?

How do you group dates  that fall within specific date ranges? Is it by formula or by grouping by month, but the grouping won't work if you want an odd date range like from the 9th of one month to the 10th of the next month.

 

7 Replies

  • Hi MMH11 

     

    There are many ways to handle your query, If you have single range of date, then I would recommend you using IF function (You can add multiple criteria in IF function, but formula will become too complex). I'm attaching Excel Workbook with few examples with IF , VLOOKUP & XLOOKUP.

     

    Hope this might be helpful. 

     

     

    Regards, Faraz Shaikh | MCT, MIE, MOS Master, Excel Expert | www.ExcelExciting.com

     

    • MMH11's avatar
      MMH11
      Copper Contributor

      ExcelExciting  Sorry, I don't think I was very clear in my question. 

       

      I have a list of employees with their work dates in a given year.  I want to insert a formula that indicates which period they fall in but it has to be a date from 15th to 14th of following month. So if the date is 01/05/2020 it should fall in the period 12/15/2019-01/14/2020. What formula would do this?
      Employee     Work Date      PERIOD
      John         01/05/2020         12/15/2019-01/14/2020
      John         01/15/2020          01/15/2020-02/14/2020
      John         02/05/2020          01/15/2020-02/14/2020
      John         03/06/2020          02/15/2020-03/14/2020

      • Riny_van_Eekelen's avatar
        Riny_van_Eekelen
        Platinum Contributor

        MMH11 Alternatively, use one of the solutions in the attached workbook. The first one determines both the start and the end of the period, based on the start day (15 in your case). It uses the fairly neat EOMONTH function. The second option combines start and end of the period into one text string.

        Cell B1 contains the start day of your period and I gave it the name "from".

         

Resources