HELP!!!
I have a large IF statement that identifies certain criteria. When the criteria is met, an average is performed on a certain column for all rows meeting all points of criteria. One piece of criteria I cannot find a way to designate is if the number is >3 and <16, or between 3 and 16. Below is the array I currently have....the portion that does not seem to work properly is the AND portion (column N is the week number calculated using the WEEKNUM function in the source table).
=IF(ISERROR(AVERAGE(IF((Report!$I$2:$I$1792=$A2)*(AND(Report!$N$2:$N$1792>3,Report!$N$2:$N$1792<16)),Report!$T$2:$T$1792))),"-",AVERAGE(IF((Report!$I$2:$I$1792=$A2)*(AND(Report!$N$2:$N$1792>3,Report!$N$2:$N$1792<16)),Report!$T$2:$T$1792)))
To simplify this further, in case there is an easier way, I want to figure a 12 week average of a specific column for all rows that I=A2. If there are none, I want a "-" instead of the #DIV/0! error. I am sure if I understood VBA, I could do this, but unfortunately I am VERY VBA illiterate. Below is my attempt at creating a BETWEEN custom function that will prompt for the Greater Than and Less than numbers.....it didn't work either....
Function Between()
xl = Application.InputBox(Prompt:= _
"Less Than", Type:=1)
xg = Application.InputBox(Prompt:= _
"Greater Than", Type:=1)
If xl > (Number1) And xg < (Number2) Then
Exit Function
End If
End Function
If someone could help me either correct the custom function, correct my formula so I can specify the week number range, or tell me a simpler way to average the past 12 weeks of data in column T that also equal A2 in column I, I would be forever in your debt (truly......today is my third day working on this!!! I'm at my wits end!!!)
Bookmarks