Help with AverageIFS

reberryjr

Well-known Member
Joined
Mar 16, 2017
Messages
701
Office Version
  1. 365
Platform
  1. Windows
I'm trying to find the average days someone takes to make a decision within a certain period of time. For some reason, all of these lines return the same value, but that value is only correct for the last line. When I use the same structure as a formula in a worksheet, I get the correct values. The only difference that I can see between the lines, is the portion in red font.

Column AE houses formulae that determine the number of days for each decision. I don't think the formulae are the issue, as the last line below returns the correct value.

Rich (BB code):
Me.txt_PAppTT = WorksheetFunction.AverageIfs(mP.Range("AE:AE"), mP.Range("P:P"), Me.cobo_Assoc.Value, mP.Range("T:T"), "Approved", mP.Range("S:S"), ">=" & CDate(Me.txt_Start), mP.Range("S:S"), "<=" & CDate(Me.txt_End))
Me.txt_PDenTT = WorksheetFunction.AverageIfs(mP.Range("AE:AE"), mP.Range("P:P"), Me.cobo_Assoc.Value, mP.Range("T:T"), "Denied", mP.Range("S:S"), ">=" & CDate(Me.txt_Start), mP.Range("S:S"), "<=" & CDate(Me.txt_End))
Me.txt_PTT = WorksheetFunction.AverageIfs(mP.Range("AE:AE"), mP.Range("P:P"), Me.cobo_Assoc.Value, mP.Range("S:S"), ">=" & CDate(Me.txt_Start), mP.Range("S:S"), "<=" & CDate(Me.txt_End))

What am I missing here?
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
I'm trying to find the average days someone takes to make a decision within a certain period of time. For some reason, all of these lines return the same value, but that value is only correct for the last line. When I use the same structure as a formula in a worksheet, I get the correct values. The only difference that I can see between the lines, is the portion in red font.

Column AE houses formulae that determine the number of days for each decision. I don't think the formulae are the issue, as the last line below returns the correct value.

Rich (BB code):
Me.txt_PAppTT = WorksheetFunction.AverageIfs(mP.Range("AE:AE"), mP.Range("P:P"), Me.cobo_Assoc.Value, mP.Range("T:T"), "Approved", mP.Range("S:S"), ">=" & CDate(Me.txt_Start), mP.Range("S:S"), "<=" & CDate(Me.txt_End))
Me.txt_PDenTT = WorksheetFunction.AverageIfs(mP.Range("AE:AE"), mP.Range("P:P"), Me.cobo_Assoc.Value, mP.Range("T:T"), "Denied", mP.Range("S:S"), ">=" & CDate(Me.txt_Start), mP.Range("S:S"), "<=" & CDate(Me.txt_End))
Me.txt_PTT = WorksheetFunction.AverageIfs(mP.Range("AE:AE"), mP.Range("P:P"), Me.cobo_Assoc.Value, mP.Range("S:S"), ">=" & CDate(Me.txt_Start), mP.Range("S:S"), "<=" & CDate(Me.txt_End))

What am I missing here?
Disregard this. I found the issue elsewhere in the code.
 
Upvote 0

Forum statistics

Threads
1,215,446
Messages
6,124,897
Members
449,194
Latest member
JayEggleton

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