Hi all, hoping that somebody can help with this formula please...
I have a list of contractors, all with multiple lines for queries (for different pieces of work), with the number of days they take to respond to each query and the fiscal year that the query falls into.
So I have the following columns:
L = Contractor name
S = Number of days to respond
AD = Fiscal year (i.e. 2018/2019).
I then have a drop down elsewhere in the sheet with 'All Years' or the fiscal year (so it can be changed) and a summary table with each contractor in (listed in column B down).
The formula I have come up with is:
=IF($B$2="All Years",
SUMIF($L$21:$L$504,B11,$S$21:$S$504)/COUNTIF($L$21:$L$504,B11),
SUMIFS($L$21:$L$504,B11,$S$21:$S$504,$AD$20:$AD$504,$B$2)/COUNTIFS($L$21:$L$504,$B$10,$AD$21:$AD$504,$B$2))
However it is throwing out a #Value ! error and I can't see why that would be? In the above example, B11 contains 'ABC'.
I am trying to say, if B2 = All Years, then look at all of the contractors listed in column L, tell me the number of times 'ABC' appears and the number of cumulative days to respond, then divide that by the number of times 'ABC' appears in the column (to get the average).
HOWEVER, if B2 = anything other than 'All Years' (i.e. a specific fiscal year period, like 2018/2019), then do the same calculation but factor in the number of instances the contractor appears in that financial year alone.
I have a list of contractors, all with multiple lines for queries (for different pieces of work), with the number of days they take to respond to each query and the fiscal year that the query falls into.
So I have the following columns:
L = Contractor name
S = Number of days to respond
AD = Fiscal year (i.e. 2018/2019).
I then have a drop down elsewhere in the sheet with 'All Years' or the fiscal year (so it can be changed) and a summary table with each contractor in (listed in column B down).
The formula I have come up with is:
=IF($B$2="All Years",
SUMIF($L$21:$L$504,B11,$S$21:$S$504)/COUNTIF($L$21:$L$504,B11),
SUMIFS($L$21:$L$504,B11,$S$21:$S$504,$AD$20:$AD$504,$B$2)/COUNTIFS($L$21:$L$504,$B$10,$AD$21:$AD$504,$B$2))
However it is throwing out a #Value ! error and I can't see why that would be? In the above example, B11 contains 'ABC'.
I am trying to say, if B2 = All Years, then look at all of the contractors listed in column L, tell me the number of times 'ABC' appears and the number of cumulative days to respond, then divide that by the number of times 'ABC' appears in the column (to get the average).
HOWEVER, if B2 = anything other than 'All Years' (i.e. a specific fiscal year period, like 2018/2019), then do the same calculation but factor in the number of instances the contractor appears in that financial year alone.