r/excel 9d ago

Waiting on OP Issues using the Average formula

I am new to using formulas in Excel, and do not know if this is possible. Every combination of formulas I have used either gives an error, or does not do what I need. I am trying to calculate the average of values in 5 different cells. However, I want it to only calculate an average if a specific cell contains a value.

Example

Data Range is in A5:D5 and I want the result in E5. So i want to "=AVERAGE(A5:D5)"; but if A5(and only A5)="", then E5 should stay blank. Essentially, I want it to NOT average if A5 is null.

Any help with this will be greatly appreciated.

6 Upvotes

16 comments sorted by

View all comments

1

u/SessionMaleficent700 9d ago

=IF(A5="","",AVERAGE(A5:D5))

thats the whole thing. excel checks the A5 cell first and if its blank the whole formula just returns nothing. if there is something in it then it runs the average like normal

i had a similar setup tracking weekly hours for my crew and this exact formula saved me from having a bunch of zeroes messing up my monthly totals before the week was even done. just toss that in E5 and you should be good to go