averageifs when there is no input

Contributor

SOLVED

G'day all, 

How would i use the following formula, but not return a #div/0! error when there is not yet any input for the specific date range?

thank you

=AVERAGEIFS(GAIN_LOSS,DATE_OF_ENTRY,">="&DATE(YEAR(F51),MONTH(F51),1),DATE_OF_ENTRY,"<="&G62)

F51 and G62 are cell references to dates within a 12 month financial year period

2 Replies

@Ding080 

=IFERROR( AVERAGEIFS(GAIN_LOSS,DATE_OF_ENTRY,">="&DATE(YEAR(F51),MONTH(F51),1),DATE_OF_ENTRY,"<="&G62) ,"") 

 

Does it work with the help of the IFERROR function?

 

 

thank you, works perfectly.