AVERAGEIF - Dates based on Column K and Date in Column H to today

surkdidat

Well-known Member
Joined
Oct 1, 2011
Messages
582
Office Version
  1. 365
Hi

I am trying to work out the average number of days a certain workstream has been open (workdays)

So based on Workstream AAA I want to return 4.5 days (6+3)/2

Column H (Date Received)Column K (Workstream)(Column for info only)(Column for info only 2)
20/06AAA (open 6 days) 20 21 22 23 26 276
26/06BBB(open 2 days) 26 272
23/06AAA(open 3 days) 23 26 273
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
How about
Fluff.xlsm
HIJKLM
1
220/06/2023AAAAAA4.5
326/06/2023BBBBBB2
423/06/2023AAA
5
Master
Cell Formulas
RangeFormula
M2:M3M2=SUMPRODUCT((NETWORKDAYS(+$H$2:$H$10,TODAY()))*($K$2:$K$10=L2))/COUNTIFS($K$2:$K$10,L2)
 
Upvote 1
How about
Fluff.xlsm
HIJKLM
1
220/06/2023AAAAAA4.5
326/06/2023BBBBBB2
423/06/2023AAA
5
Master
Cell Formulas
RangeFormula
M2:M3M2=SUMPRODUCT((NETWORKDAYS(+$H$2:$H$10,TODAY()))*($K$2:$K$10=L2))/COUNTIFS($K$2:$K$10,L2)
Thank you, I have tried extending this for the whole column (or doing it as a range to cell 1000, but get #VALUE! - I have just realised (guessed) this is because the sheet it comes from is essentially formulas as the data in imported onto the live tracker from a data sheet held elsewhere........... (ie where I have extended it down to row 1000, some of these columns/rows will still be "blank" at present (due to the formula having no data to import into that cell...... =
Excel Formula:
IF(TableExtract.csv!I833=0,"",TableExtract.csv!I833)
 
Upvote 0
Ok, how about
Excel Formula:
=SUMPRODUCT((IFERROR(NETWORKDAYS(+$H$2:$H$10,TODAY()),0))*($K$2:$K$10=L2))/COUNTIFS($K$2:$K$10,L2)
 
Upvote 1
Solution
Thank you, and apologies for not giving the full information out first time!
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,417
Messages
6,124,789
Members
449,188
Latest member
Hoffk036

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?

Disable AdBlock

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
Back
Top