How to get an AVERAGE when some cells have NO VALUE

mantis

New Member
Hi, I'm hoping someone can help!

I have a spreadsheet that uses an API to gather data from another program and then returns a value into the same cell the API formula is in.

I have 10 of these formulas from A1 to A10. I need an average of these values so i use "=AVERAGE(A1:A10)"

This works great once all 10 cells have a value but the API gathers the info due to specific things happening on the other program so A1 will get a value, then A2 could get a value an hour later, A3 ten minutes after that and so on.

HOW DO I GET EXCEL TO GIVE ME THE AVERAGE OF THE CELLS THAT HAVE A VALUE AND IGNORE THE ONES THAT DONT??????? So it'll give me the average of the first 2 cells, then the first 3 an so on until all 10 have a value.

Many thanks for taking the time to read my problem.

Mantis.

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.

barry houdini

MrExcel MVP
Hello mantis, welcome to MrExcel,

AVERAGE function ignores blanks so if the cells without a value are blank =AVERAGE(A1:A10) should still work, if only A1 and A2 have numbers and the others are blank then that formula will just average those two.

If you want to ignore zeroes try

=SUMIF(A1:A10,">0")/MAX(1,COUNTIF(A1:A10,">0"))

mantis

New Member
Thanks for such a quick response Barry. Your formula works perfectly.
Regards,
Mantis

kevinwalker

New Member
=SUM(C5:C14)/COUNTIF(C5:C14,"<>0")
this is a sample formula that calculated the average of number greater than or less than zero

Replies
1
Views
119
Replies
6
Views
237
Replies
3
Views
609
Replies
3
Views
483
Replies
19
Views
465

1,191,228
Messages
5,985,392
Members
439,962
Latest member
max_york

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back