Forum Discussion

kenmustafa9's avatar
kenmustafa9
Copper Contributor
Sep 16, 2021
Solved

Using averageif to find average number of days employed in 2020 and 2021

Hi, everyone, on the far right of the excel worksheet i attached below, I'm trying to find the average number of days for nurses who's term date was in 2020, and also trying to find the average for n...
  • HansVogelaar's avatar
    Sep 16, 2021

    kenmustafa9 

    The values in columns F and G are not real dates, but text values. To correct this:

     

    Select column F.

    On the Data tab of the ribbon, click Text to Columns.

    In Step 1 of the Convert Text to Columns Wizard, click Next >.

    In Step 2, do the same.

    In Step 3, select MDY from the drop-down next to Date.

    Click Finish.

     

    Do the same for column G.

     

    Change the formula in N2 to

    =AVERAGEIF(G2:G247,"<"&N4,H2:H247)

    and that in O2 to

    =AVERAGEIF(G2:G247,">"&N5,H2:H247)

Resources