# Date Calculation

#### snjpverma

##### Well-known Member
Hi Experts,

My data is as below. is the output in Column G possible without helper column C?

 A B C D E F G 1 Name Dates Difference Output average 2 John 4/29/2018 4 John 22.5 3 Tom 4/16/2018 14 Tom 22.25 4 Von 4/13/2018 15 Von 27 5 John 3/13/2018 38 6 Tom 4/4/2018 22 7 Von 3/18/2018 34 8 John 3/18/2018 34 9 Tom 3/29/2018 26 10 Von 4/5/2018 21 11 John 4/15/2018 14 12 Tom 3/28/2018 27 13 Von 3/13/2018 38

<colgroup><col style="font-weight:bold; width:30px; "><col style="width:64px;"><col style="width:73px;"><col style="width:73px;"><col style="width:64px;"><col style="width:64px;"><col style="width:64px;"><col style="width:104px;"></colgroup><tbody>
</tbody>

 Cell Formula C2 =NETWORKDAYS(B2,TODAY()-1) G2 =AVERAGEIF(\$A\$2:\$A\$13,F2,\$C\$2:\$C\$13) G3 =AVERAGEIF(\$A\$2:\$A\$13,F3,\$C\$2:\$C\$13) G4 =AVERAGEIF(\$A\$2:\$A\$13,F4,\$C\$2:\$C\$13)

<tbody>
</tbody>

<tbody>
</tbody>

Excel tables to the web >> Excel Jeanie HTML 4

Last edited:

### Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple

#### snjpverma

##### Well-known Member
Just to highlight that the formula used column C has been mentioned at the bottom in Post #1 . It is a networkdays function which I use to find the difference from yesterday to the Date in Column B.

#### snjpverma

##### Well-known Member
any formula for this one? The only thing I want is: get the average of networkdays without the helper column C.
Column C is the networkdays from Date in column B to Yesterday.

This is basically what I want.

=Averageif(A\$2:A13,F2,Networkdays(B2:B13),Yesterday)

But the networkdays doesn't accept the array function in this manner.

Last edited:

##### MrExcel MVP
In G2 control+shift+enter, not just enter, and copy down:
Rich (BB code):
``````=AVERAGE(IF(\$A\$2:\$A\$13=F2,NETWORKDAYS(\$B\$2:\$B\$13+0,TODAY()-1)))
``````

#### snjpverma

##### Well-known Member
wow that's brilliant Aladin. I was trying this for so long.
This forum is full of genius people. Whenever I come here, I learn something new.

Replies
4
Views
203
Replies
13
Views
606
Replies
37
Views
2K
Replies
5
Views
191
Replies
5
Views
430

1,129,835
Messages
5,638,621
Members
417,038
Latest member
VBAstudent1977

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

### Which adblocker are you using?

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

### Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back