Forum Discussion

donchips90's avatar
donchips90
Copper Contributor
Feb 07, 2022
Solved

Excel on COUNTIFS

Can anyone help with what is wrong in this formula
=COUNTIFS(B2:B5,">=EOMONTH(TODAY(),-2) +1",C2:C5,"N/A",D2:D5,"<=EOMONTH(TODAY(),-2) +28")
it's return value is just zero. please help me.

  • donchips90 

    Place the expressions using EOMONTH outside the quotes:

     

    =COUNTIFS(B2:B5,">="&EOMONTH(TODAY(),-2) +1,C2:C5,"N/A",D2:D5,"<="&EOMONTH(TODAY(),-2) +28)

3 Replies

  • donchips90 

    Place the expressions using EOMONTH outside the quotes:

     

    =COUNTIFS(B2:B5,">="&EOMONTH(TODAY(),-2) +1,C2:C5,"N/A",D2:D5,"<="&EOMONTH(TODAY(),-2) +28)

    • donchips90's avatar
      donchips90
      Copper Contributor

      HansVogelaar thanks for the solution it has helped i appreciate.

      but i have failed to understand again why still it fails to from this data i have attached excel workbook link. please try to see if you can help. or if anyone can, please.https://1drv.ms/x/s!AtpPCuFXM6F2jDNkzxyxkGZN4WjD?e=9lLVxd 

      • HansVogelaar's avatar
        HansVogelaar
        MVP

        donchips90 

        The values in the DATES, DATES2 and DATES3 columns look like dates but they are text values.

        To correct this:

        • Select the DATES column.
        • On the Data tab of the ribbon, click Text to Columns.
        • Click Next > twice.
        • Select Date, and select DMY from the drop down list next to it.
        • Click Finish.
        • Repeat for the other two date columns.

        See the attached version.

Resources