Hello!
I could really use a hand with a frustrating set of formulas. Here's the setup. I have tabular data, such as:
Col A Col B Col C
Name Type Time
Bob Incident 30
Susan Request 10
Bob Incident 20
Dan Other 40
on a sheet called "TT Data." There are a few sets of calculations I need to perform. One is to calculate the Average and Median Time for all rows with Type "Incident". This I have been able to get, with the following formulas:
=AVERAGEIF('TT Data'!B1:B50000, "=Incident", 'TT Data'!C1:C50000)
{=MEDIAN(IF('TT Data'!B1:B50000="Incident",'TT Data'C1:C50000))}
So far so good (hopefully those formula are correct!). Now things get a little trickier, as I need to find the Average and Median Time for all rows that are Type “Incident” and Name “Bob”
Averageifs seems to work OK:
=AVERAGEIFS('TT Data'!C1:C50000,'TT Data'!B1:B50000,"=Incident",'TT Data'!A1:A50000,"=Bob" )
I’m running into trouble trying to use a logical AND operation in the array Median/nested IF function. Here is the formula I’m using:
{=MEDIAN(IF(AND('TT Data'!B1:B50000="Incident",'TT Data'!A1:A50000="Bob"),'TTR= Data'!C1:C50000))}
Excel accepts the formula, and spits out a total, but I know it’s incorrect. Looking further, it appears that as soon as it encounters a row that does not meet the criteria, the total is always zero. To test, I limited the range to one that I knew included only those that meet the criteria, and the median result was correct. Why does this happen? Is there a better way to “AND” these criteria together?
Thank you very much for any advice!
Bookmarks