Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Sick Puppy
 
Posts: n/a
Default Get aveages for last few days

I am making a new spreadsheet to record daily blood pressure readings. Each
day's readings go into a row below the previous day's readings. I can use
"=average" to get the average for all entries. Is there a function or other
means of getting the average for, for instance, the last 30 entries, which
would be for the last 30 days?

Thanks in advance!

Tim
  #2   Report Post  
N Harkawat
 
Posts: n/a
Default

if your values are continuous with no blanks in the middle then
=AVERAGE(OFFSET(INDIRECT(ADDRESS(1,1)),MATCH(99999 99999,A:A)-30,,30))
will average last 30 values in column A and will give error if you have less
than 30 readings.







"Sick Puppy" <Sick wrote in message
...
I am making a new spreadsheet to record daily blood pressure readings.
Each
day's readings go into a row below the previous day's readings. I can use
"=average" to get the average for all entries. Is there a function or
other
means of getting the average for, for instance, the last 30 entries, which
would be for the last 30 days?

Thanks in advance!

Tim



  #3   Report Post  
Sick Puppy
 
Posts: n/a
Default

First, Harkawat, thanks to both you and Domenic for replying -- especially so
quickly!

Next, I hope you and Domenic will both forgive me. I should have been more
descriptive and specific in my initial post.

I actually have it so that I can enter information for each of these time
periods:

Date | Morning | Noon | Afternoon | Evening | Night

To help me explain easier, please open this screen-shot image of my
spreadsheet:
http://home.earthlink.net/~wiff.them/Image1.jpg

As you can see (hopefully), "Date" is a single, date formatted column.

The other, time-of-day items are actually headings which are centered across
4 columns. The 4 columns are not labeled, but a

Systolic (higher BP reading) | / | Diastolic (lower BP reading) | Pulse

On any given day, I may only take Blood Pressure readings in one, two,
three, etc., of the daily time periods. I also might skip taking readings
for a day -- or skip taking readings for several days.

Because of these situations, I would end up with occasional blank cells in
the range to be averaged, and it also might be that I would not have entries
for 30 consecutive days. I suppose it could be that I might only have 5 rows
of entries that extend back 30 days and should be averaged.

The key is that I want to be able t average all the readings I took during
the previous 30 days, but no further back.

I hope I am being clearer now.

THANKS AGAIN for your assistance!!!

Tim

From: The Mountain, Cough Drop Div.
···· Date & Time Composed ····
June 22, 2005
2:54 pm EASTERN STANDARD TIME -- USA
  #4   Report Post  
Domenic
 
Posts: n/a
Default

Try the following...

1) Select B11

2) Define the following ranges:

Insert Define Name

Name: Date

Refers to:
=Sheet1!$A$14:INDEX(Sheet1!$A$14:$A$65536,MATCH(9. 99999999999999E+307,She
et1!$A$14:$A$65536))

Click Add

Name: Readings

Refers to:
=Sheet1!B14:INDEX(Sheet1!B14:B65536,MATCH(9.999999 99999999E+307,Sheet1!$A
$14:$A$65536))

Click Ok

3) Enter the following formula in B11 and copy across:

=AVERAGE(IF((DateTODAY()-30)*(Readings0),Readings))

....confirmed with CONTROL+SHIFT+ENTER, not just ENTER.

4) Use conditional formatting to hide #DIV/0! error values that will
result when there's no data. If you need help with this, post back.

Hope this helps!

In article ,
"Sick Puppy" wrote:

First, Harkawat, thanks to both you and Domenic for replying -- especially so
quickly!

Next, I hope you and Domenic will both forgive me. I should have been more
descriptive and specific in my initial post.

I actually have it so that I can enter information for each of these time
periods:

Date | Morning | Noon | Afternoon | Evening | Night

To help me explain easier, please open this screen-shot image of my
spreadsheet:
http://home.earthlink.net/~wiff.them/Image1.jpg

As you can see (hopefully), "Date" is a single, date formatted column.

The other, time-of-day items are actually headings which are centered across
4 columns. The 4 columns are not labeled, but a

Systolic (higher BP reading) | / | Diastolic (lower BP reading) | Pulse

On any given day, I may only take Blood Pressure readings in one, two,
three, etc., of the daily time periods. I also might skip taking readings
for a day -- or skip taking readings for several days.

Because of these situations, I would end up with occasional blank cells in
the range to be averaged, and it also might be that I would not have entries
for 30 consecutive days. I suppose it could be that I might only have 5 rows
of entries that extend back 30 days and should be averaged.

The key is that I want to be able t average all the readings I took during
the previous 30 days, but no further back.

I hope I am being clearer now.

THANKS AGAIN for your assistance!!!

Tim

From: The Mountain, Cough Drop Div.
···· Date & Time Composed ····
June 22, 2005
2:54 pm EASTERN STANDARD TIME -- USA

  #5   Report Post  
Sick Puppy
 
Posts: n/a
Default

Domenic!

Whoa!!! Cool! It works!

I actually had 4 sheets in the workbook (one for each person in my family
that I'm tracking), so I had to modify the ~Sheet1~ to being ~'Family Member
Name'~, but I managed to figure that out.

I also wasn't familiar with the CTRL-SHIFT-ENTER thing. From what I can see
in the Help file, it is for arrays. This is my first array.

I'll see if I can figure out where the conditional formatting ~if~
statements go to get rid of the errors. At first I guessed that they would
be before the { symbol, but that doesn't seem to be right. If you want to
give me a clue as to where to put them, that would be great.

THANKS AGAIN!

Tim

From: The Mountain, Cough Drop Div.
···· Date & Time Composed ····
June 22, 2005
5:54 pm EASTERN STANDARD TIME -- USA


  #6   Report Post  
Domenic
 
Posts: n/a
Default

For conditional formatting, try the following...

1) Select B11

2) Format Conditional Formatting Formula Is:

=ISERR(B11)

3) Choose 'White' as your font color

4) Click Ok

5) Copy format to other cells using either the 'Format Painter' or 'Copy
Paste Special Formats'.


Hope this helps!

In article ,
"Sick Puppy" wrote:

Domenic!

Whoa!!! Cool! It works!

I actually had 4 sheets in the workbook (one for each person in my family
that I'm tracking), so I had to modify the ~Sheet1~ to being ~'Family Member
Name'~, but I managed to figure that out.

I also wasn't familiar with the CTRL-SHIFT-ENTER thing. From what I can see
in the Help file, it is for arrays. This is my first array.

I'll see if I can figure out where the conditional formatting ~if~
statements go to get rid of the errors. At first I guessed that they would
be before the { symbol, but that doesn't seem to be right. If you want to
give me a clue as to where to put them, that would be great.

THANKS AGAIN!

Tim

From: The Mountain, Cough Drop Div.
···· Date & Time Composed ····
June 22, 2005
5:54 pm EASTERN STANDARD TIME -- USA

  #7   Report Post  
Sick Puppy
 
Posts: n/a
Default

Domenic,

I've got the ~if~ statement covered now. THANKS!


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert # of days to years/days Marlene Mayer Excel Discussion (Misc queries) 3 April 27th 05 02:27 AM
formula to calculate # of days between dates, excluding holidays abs2299 Excel Discussion (Misc queries) 8 March 3rd 05 02:21 AM
HOW TO CALCULATE THE DAYS? Bel Excel Worksheet Functions 2 February 2nd 05 07:05 PM
Subracting Dates to come up with the # of days between them KimberlyC Excel Worksheet Functions 8 December 20th 04 09:46 PM
Help! I am stuck calculating Days, Hours, Mins please help OB1 Excel Worksheet Functions 3 November 15th 04 05:17 PM


All times are GMT +1. The time now is 01:22 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"