Index match issue

KDavidP1987

Board Regular
Joined
Mar 6, 2018
Messages
51
Greetings all,

I'm running into an issue with part of an INDEX MATCH array and don't know how to resolve it.

Context: Manager asked that I setup a table to calculate the average calls offered to agents on a 30 day rotation against the days they are WFH (work from home). So, I need needed to get the days they were WFH into a table, and the daily totals of calls they take. Then I needed to merge the data (done), and setup a calculation to provide the 30 day average for each day listed as WFH

Here is the code I came up with to calculate this. (it runs, but the numbers don't seem right)

Code:
   =IF([@IsWFHDay]="WFH", AVERAGE(INDEX(Table1[[Agent]:[Calls Answered]],MATCH(1,([Agent]=[@Agent])*([Date]<=[@Date])*([Date]>=[@Date]-30),0),3)),"")

I've broken it down into pieces, and everything works correctly but one section.

Code:
 MATCH(1,([Agent]=[@Agent])*[COLOR=#ff0000][B]([Date]<=[@Date])*([Date]>=[@Date]-30)[/B][/COLOR]

It seems the issue is with the Match section. I need it to pull an array of calls offered on days between the date the agent was WFH and going back 30 days. I originally tried using an AND operator in the match function, but that didn't work. How can I specify this range of time in the formula?

Anyone have an idea how I can accomplish this? Or if there is an easier way
 
Last edited:

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
If you're trying to calculate the average calls on WFH days...for all calls for the previous 30 days...
Try something like this:
Code:
=IF([@IsWFHDay]="WFH", AVERAGEIFS([Calls Answered],[Agent],[@Agent],[Date],"<="&[@Date],[Date],">="&[@Date]-30),"")

But...If you want the average for ONLY WHF days in that range...then this:
Code:
=IF([@IsWFHDay]="WFH", AVERAGEIFS([Calls Answered],[IsWFHDay],"WFH",[Agent],[@Agent],[Date],"<="&[@Date],[Date],">="&([@Date]-30)),"")


Is tht something you can work with?
 
Last edited:
Upvote 0
If you're trying to calculate the average calls on WFH days...for the previous 30 days...
Try something like this:
Code:
=IF([@IsWFHDay]="WFH", AVERAGEIFS([Calls Answered],[Agent],[@Agent],[Date],"<="&[@Date],[Date],">="&[@Date]-30),"")

Is that something you can work with?

That is a great idea! However, when I tried it I receive #DIV/0! for some reason. Been trying to play around with it to return a good value. I don't have much experience using the AVERAGEIFS function, so I'm having trouble figuring out what it could be
 
Upvote 0
[TABLE="width: 1045"]
<colgroup><col><col span="6"><col span="2"><col span="7"></colgroup><tbody>[TR]
[TD]date[/TD]
[TD]agent[/TD]
[TD]where?[/TD]
[TD]CALLS[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]01/03/2018[/TD]
[TD]agenta[/TD]
[TD]W[/TD]
[TD="align: right"]105[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]01/03/2018[/TD]
[TD]agentb[/TD]
[TD]W[/TD]
[TD="align: right"]120[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]01/03/2018[/TD]
[TD]agentc[/TD]
[TD]W[/TD]
[TD="align: right"]95[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 4"]ASSUME WE WANT 5 DAY ANALYSIS[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]02/03/2018[/TD]
[TD]agenta[/TD]
[TD]H[/TD]
[TD="align: right"]100[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]02/03/2018[/TD]
[TD]agentb[/TD]
[TD]W[/TD]
[TD="align: right"]105[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]agenta[/TD]
[TD]agenta[/TD]
[TD]agentb[/TD]
[TD]agentb[/TD]
[TD]agentc[/TD]
[TD]agentc[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]02/03/2018[/TD]
[TD]agentc[/TD]
[TD]H[/TD]
[TD="align: right"]120[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]H[/TD]
[TD]W[/TD]
[TD]H[/TD]
[TD]W[/TD]
[TD]H[/TD]
[TD]W[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]03/03/2018[/TD]
[TD]agenta[/TD]
[TD]H[/TD]
[TD="align: right"]95[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]01/03/2018[/TD]
[TD="align: right"]05/03/2018[/TD]
[TD="align: right"]315[/TD]
[TD="align: right"]210[/TD]
[TD="align: right"]100[/TD]
[TD="align: right"]440[/TD]
[TD="align: right"]120[/TD]
[TD="align: right"]600[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]03/03/2018[/TD]
[TD]agentb[/TD]
[TD]H[/TD]
[TD="align: right"]100[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]06/03/2018[/TD]
[TD="align: right"]10/03/2018[/TD]
[TD="align: right"]520[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]220[/TD]
[TD="align: right"]305[/TD]
[TD="align: right"]120[/TD]
[TD="align: right"]420[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]03/03/2018[/TD]
[TD]agentc[/TD]
[TD]W[/TD]
[TD="align: right"]105[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]04/03/2018[/TD]
[TD]agenta[/TD]
[TD]H[/TD]
[TD="align: right"]120[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]04/03/2018[/TD]
[TD]agentb[/TD]
[TD]W[/TD]
[TD="align: right"]95[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]04/03/2018[/TD]
[TD]agentc[/TD]
[TD]W[/TD]
[TD="align: right"]100[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]05/03/2018[/TD]
[TD]agenta[/TD]
[TD]W[/TD]
[TD="align: right"]105[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]05/03/2018[/TD]
[TD]agentb[/TD]
[TD]W[/TD]
[TD="align: right"]120[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 4"]is this the sort of output you want ?[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]05/03/2018[/TD]
[TD]agentc[/TD]
[TD]W[/TD]
[TD="align: right"]300[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]06/03/2018[/TD]
[TD]agenta[/TD]
[TD]H[/TD]
[TD="align: right"]100[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]06/03/2018[/TD]
[TD]agentb[/TD]
[TD]W[/TD]
[TD="align: right"]105[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]06/03/2018[/TD]
[TD]agentc[/TD]
[TD]H[/TD]
[TD="align: right"]120[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]07/03/2018[/TD]
[TD]agenta[/TD]
[TD]H[/TD]
[TD="align: right"]95[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]07/03/2018[/TD]
[TD]agentb[/TD]
[TD]H[/TD]
[TD="align: right"]100[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]07/03/2018[/TD]
[TD]agentc[/TD]
[TD]W[/TD]
[TD="align: right"]105[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]08/03/2018[/TD]
[TD]agenta[/TD]
[TD]H[/TD]
[TD="align: right"]120[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]08/03/2018[/TD]
[TD]agentb[/TD]
[TD]W[/TD]
[TD="align: right"]95[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]08/03/2018[/TD]
[TD]agentc[/TD]
[TD]W[/TD]
[TD="align: right"]100[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]09/03/2018[/TD]
[TD]agenta[/TD]
[TD]H[/TD]
[TD="align: right"]105[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]09/03/2018[/TD]
[TD]agentb[/TD]
[TD]H[/TD]
[TD="align: right"]120[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]09/03/2018[/TD]
[TD]agentc[/TD]
[TD]W[/TD]
[TD="align: right"]95[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]10/03/2018[/TD]
[TD]agenta[/TD]
[TD]H[/TD]
[TD="align: right"]100[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]10/03/2018[/TD]
[TD]agentb[/TD]
[TD]W[/TD]
[TD="align: right"]105[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]10/03/2018[/TD]
[TD]agentc[/TD]
[TD]W[/TD]
[TD="align: right"]120[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]11/03/2018[/TD]
[TD]agenta[/TD]
[TD]W[/TD]
[TD="align: right"]95[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]11/03/2018[/TD]
[TD]agentb[/TD]
[TD]W[/TD]
[TD="align: right"]100[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]11/03/2018[/TD]
[TD]agentc[/TD]
[TD]W[/TD]
[TD="align: right"]105[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]12/03/2018[/TD]
[TD]agenta[/TD]
[TD]H[/TD]
[TD="align: right"]120[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]12/03/2018[/TD]
[TD]agentb[/TD]
[TD]W[/TD]
[TD="align: right"]95[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]12/03/2018[/TD]
[TD]agentc[/TD]
[TD]H[/TD]
[TD="align: right"]100[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
I don't know why this isn't working, why it keeps returning #DIV/0!

Looking at the formula, there is no reason for it not to work, that I can find.
 
Last edited:
Upvote 0
How in the world did you paste a table? I tried typing one in earlier but couldn't figure it out.
(NVM, figured it out, I think [below])

Is there a way I could paste a picture from my computer, then you would see how it's laid out?

Its setup to do the calculations and then present the relevant info in a Pivot Table. Silly use of pivot table, I know... with essentially no actual calculations taking place (they're all on the worksheet itself). Just saves me time from having to refilter it each week and send the table to management.

[TABLE="width: 1047"]
<tbody>[TR]
[TD="class: xl67, width: 166"]Agent[/TD]
[TD="class: xl69, width: 72"]Date[/TD]
[TD="class: xl68, width: 119"]Calls Offered[/TD]
[TD="class: xl68, width: 134"]Calls Answered[/TD]
[TD="class: xl67, width: 133"]IsWFHDay[/TD]
[TD="class: xl67, width: 89"]Month[/TD]
[TD="class: xl71, width: 131"]HasWFH withinMonth[/TD]
[TD="class: xl71, width: 102"]30 Day WFH CO Avg [/TD]
[TD="class: xl71, width: 101"] 30 Day WFH CA Avg[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="width: 1047"]
<colgroup><col><col><col><col><col><col><col><col><col></colgroup><tbody>[TR]
[TD]Contoso Agent[/TD]
[TD]01/09/2018[/TD]
[TD]36[/TD]
[TD]33[/TD]
[TD]Office[/TD]
[TD]January[/TD]
[TD]No WFH[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Contoso Agent[/TD]
[TD]01/10/2018 [/TD]
[TD]30[/TD]
[TD]28[/TD]
[TD]Office[/TD]
[TD]January[/TD]
[TD]No WFH[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Contoso Agent[/TD]
[TD]01/11/2018[/TD]
[TD]26[/TD]
[TD]23[/TD]
[TD]Office[/TD]
[TD]January[/TD]
[TD]No WFH[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Contoso Agent[/TD]
[TD]01/12/2018[/TD]
[TD]42[/TD]
[TD]41[/TD]
[TD]Office[/TD]
[TD]January[/TD]
[TD]No WFH[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Contoso Agent[/TD]
[TD]01/15/2018[/TD]
[TD]44[/TD]
[TD]39[/TD]
[TD]Office[/TD]
[TD]January[/TD]
[TD]No WFH[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Contoso Agent[/TD]
[TD]01/16/2018[/TD]
[TD]36[/TD]
[TD]35[/TD]
[TD]Office[/TD]
[TD]January[/TD]
[TD]No WFH[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Contoso Agent[/TD]
[TD]01/17/2018[/TD]
[TD]30[/TD]
[TD]29[/TD]
[TD]Office[/TD]
[TD]January[/TD]
[TD]No WFH[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Contoso Agent[/TD]
[TD]01/18/2018[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]Office[/TD]
[TD]January[/TD]
[TD]No WFH[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Contoso Agent[/TD]
[TD]01/19/2018[/TD]
[TD]44[/TD]
[TD]40[/TD]
[TD]Office[/TD]
[TD]January[/TD]
[TD]No WFH[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Contoso Agent[/TD]
[TD]01/22/2018[/TD]
[TD]47[/TD]
[TD]44[/TD]
[TD]Office[/TD]
[TD]January[/TD]
[TD]No WFH[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Contoso Agent[/TD]
[TD]01/23/2018[/TD]
[TD]40[/TD]
[TD]40[/TD]
[TD]Office[/TD]
[TD]January[/TD]
[TD]No WFH[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Contoso Agent[/TD]
[TD]01/24/2018[/TD]
[TD]37[/TD]
[TD]37[/TD]
[TD]Office[/TD]
[TD]January[/TD]
[TD]No WFH[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Contoso Agent[/TD]
[TD]01/25/2018[/TD]
[TD]37[/TD]
[TD]36[/TD]
[TD]Office[/TD]
[TD]January[/TD]
[TD]No WFH[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Contoso Agent[/TD]
[TD]01/26/2018[/TD]
[TD]41[/TD]
[TD]41[/TD]
[TD]Office[/TD]
[TD]January[/TD]
[TD]No WFH[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Contoso Agent[/TD]
[TD]01/29/2018[/TD]
[TD]20[/TD]
[TD]17[/TD]
[TD]Office[/TD]
[TD]January[/TD]
[TD]No WFH[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Contoso Agent[/TD]
[TD]01/30/2018[/TD]
[TD]26[/TD]
[TD]23[/TD]
[TD]Office[/TD]
[TD]January[/TD]
[TD]No WFH[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Contoso Agent[/TD]
[TD]01/31/2018[/TD]
[TD]26[/TD]
[TD]24[/TD]
[TD]Office[/TD]
[TD]January[/TD]
[TD]No WFH[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Contoso Agent[/TD]
[TD]02/02/2018[/TD]
[TD]35[/TD]
[TD]32[/TD]
[TD]Office[/TD]
[TD]February[/TD]
[TD]WFH[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Contoso Agent[/TD]
[TD]02/05/2018[/TD]
[TD]33[/TD]
[TD]31[/TD]
[TD]Office[/TD]
[TD]February[/TD]
[TD]WFH[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Contoso Agent[/TD]
[TD]02/06/2018[/TD]
[TD]48[/TD]
[TD]46[/TD]
[TD]Office[/TD]
[TD]February[/TD]
[TD]WFH[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Contoso Agent[/TD]
[TD]02/12/2018[/TD]
[TD]33[/TD]
[TD]32[/TD]
[TD]Office[/TD]
[TD]February[/TD]
[TD]WFH[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Contoso Agent[/TD]
[TD]02/13/2018[/TD]
[TD]27[/TD]
[TD]27[/TD]
[TD]Office[/TD]
[TD]February[/TD]
[TD]WFH[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Contoso Agent[/TD]
[TD]02/14/2018[/TD]
[TD]28[/TD]
[TD]25[/TD]
[TD]Office[/TD]
[TD]February[/TD]
[TD]WFH[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Contoso Agent[/TD]
[TD]02/16/2018[/TD]
[TD]39[/TD]
[TD]37[/TD]
[TD]Office[/TD]
[TD]February[/TD]
[TD]WFH[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Contoso Agent[/TD]
[TD]02/19/2018[/TD]
[TD]25[/TD]
[TD]24[/TD]
[TD]Office[/TD]
[TD]February[/TD]
[TD]WFH[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Contoso Agent[/TD]
[TD]02/20/2018[/TD]
[TD]32[/TD]
[TD]29[/TD]
[TD]Office[/TD]
[TD]February[/TD]
[TD]WFH[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Contoso Agent[/TD]
[TD]02/21/2018[/TD]
[TD]28[/TD]
[TD]27[/TD]
[TD]Office[/TD]
[TD]February[/TD]
[TD]WFH[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Contoso Agent[/TD]
[TD]02/22/2018[/TD]
[TD]42[/TD]
[TD]37[/TD]
[TD]Office[/TD]
[TD]February[/TD]
[TD]WFH[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Contoso Agent[/TD]
[TD]02/23/2018[/TD]
[TD]27[/TD]
[TD]25[/TD]
[TD]WFH[/TD]
[TD]February[/TD]
[TD]WFH[/TD]
[TD="align: right"]38[/TD]
[TD="align: center"]#DIV/0![/TD]
[/TR]
</tbody>[/TABLE]
 
Last edited:
Upvote 0
the 38 you see in the last record comes from

Code:
 =IF([@IsWFHDay]="WFH", AVERAGE(INDEX(Table1[[Agent]:[Calls Answered]],MATCH(1,([Agent]=[@Agent])*([Date]<=[@Date])*([Date]>=[@Date]-30),0),3)),"")

The #DIV/!0! comes from

Code:
 =IF([@IsWFHDay]="WFH", AVERAGEIFS([Calls Answered],[Agent],[@Agent],[Date],"<="&[@Date],[Date],">="&[@Date]-30),"")
 
Upvote 0
If you're trying to calculate the average calls on WFH days...for all calls for the previous 30 days...
Try something like this:
Code:
=IF([@IsWFHDay]="WFH", AVERAGEIFS([Calls Answered],[Agent],[@Agent],[Date],"<="&[@Date],[Date],">="&[@Date]-30),"")

But...If you want the average for ONLY WHF days in that range...then this:
Code:
=IF([@IsWFHDay]="WFH", AVERAGEIFS([Calls Answered],[IsWFHDay],"WFH",[Agent],[@Agent],[Date],"<="&[@Date],[Date],">="&([@Date]-30)),"")


Is tht something you can work with?

Definitely the first one! However, haven't been able to get it to work. I'm using Office Excel 2013
 
Upvote 0
If you're trying to calculate the average calls on WFH days...for all calls for the previous 30 days...
Try something like this:
Code:
=IF([@IsWFHDay]="WFH", AVERAGEIFS([Calls Answered],[Agent],[@Agent],[Date],"<="&[@Date],[Date],">="&[@Date]-30),"")

But...If you want the average for ONLY WHF days in that range...then this:
Code:
=IF([@IsWFHDay]="WFH", AVERAGEIFS([Calls Answered],[IsWFHDay],"WFH",[Agent],[@Agent],[Date],"<="&[@Date],[Date],">="&([@Date]-30)),"")


Is tht something you can work with?


After playing with it for awhile, I was able to break it down and figure out where the problem is in the code. It works (calculates the AVG) when I remove the date section of code. But when I include it I only get back #DIV/0!



Works:
Code:
=IF([@IsWFHDay]="WFH", AVERAGEIFS([Calls Answered], [Agent],[@Agent]),"")

Doesn't work:
Code:
=IF([@IsWFHDay]="WFH", AVERAGEIFS([Calls Answered], [Agent],[@Agent], [Date],"<="&[@Date], [Date],">="&[@Date]-30),"")

Code:
, [Date],"<="&[@Date], [Date],">="&[@Date]-30

Is there a reason this code may not work? I did confirm the date is calculable! I did a calculation in another cell to subtract 30 from the date, and it returned the correct value (date)
 
Upvote 0
If you're trying to calculate the average calls on WFH days...for all calls for the previous 30 days...
Try something like this:
Code:
=IF([@IsWFHDay]="WFH", AVERAGEIFS([Calls Answered],[Agent],[@Agent],[Date],"<="&[@Date],[Date],">="&[@Date]-30),"")

But...If you want the average for ONLY WHF days in that range...then this:
Code:
=IF([@IsWFHDay]="WFH", AVERAGEIFS([Calls Answered],[IsWFHDay],"WFH",[Agent],[@Agent],[Date],"<="&[@Date],[Date],">="&([@Date]-30)),"")


Is tht something you can work with?

So sorry for all the trouble, and follow-up messages. I finally figured it out! The system I pull the data from provides the date as a string. It seems while individual formulas recognize this and calculate the value, for some reason the AVERAGEIFS function has trouble with it. I used the DATEVALUE() formula to translate the string to numerical date, and it works PERFECTLY now!

Thank you very very much, sir!
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,169
Members
453,021
Latest member
Justyna P

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