Average code advice

ipbr21054

Well-known Member
Joined
Nov 16, 2010
Messages
5,731
Office Version
  1. 2007
Platform
  1. Windows
Hi,
Being a Diabetic i use excel to plot my readings every day.

I am looking to get an average reading as i enter my values each day.
Please can you advise a code to achieve this.

Cell range would be B25:AF25

At present there are only figures up to J25 being 9th of this month.
So in cell D23 would be the current average value shown.

As i then enter tomorrows reading into the next cell being K25 i would like cell D23 to take this into account & show me the new reading.

Thanks
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Hi,

I have the idea in my head of the following,

Cell B25 150 = 150

Cell C25 100 + B25 150 / 2 = 125

Cell D25 130 + C25 100 + B25 150 / 3 = 126.6

But cant put it onto paper.


Thanks
 
Upvote 0
Perhaps=AVERAGE(B25:INDEX(B25:AF25,match(9.99999999E307,B25:A25)))
 
Last edited:
Upvote 0
Hi,
The sum is incorrect & when i enter tomorrows figure into the next cell the average box in cell D23 does not update.

If i add up the 9 readings so far then divide that total by 9 i get 163.5 but the code shown above returns 175.5

Tomorrow the sum would be to add up the 10 readings then divide by 10
 
Upvote 0
Hi,
You are spot on and works very nice thanks.

Ccan i ask you a question please.
If all the cells are empty & awaiting the first result can the cell in D23 shown nothing at all etc ?

Currently i see #####

Many Thanks
 
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,187
Members
452,616
Latest member
intern444

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top