Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 21
Default Lookup and average data in an unsorted list

I'm trying to average a varying number of values based on the information in
cells giving the beginning and ending times (which will not exactly match the
data). The data array contains blank lines and can't be re-sorted.
In the fragment below, starting and stopping times are given in cells B4 and
B5. I need the formula to search column D (i.e. D1:D24) for the times
closest (or the next earlier) to the start and stop times and average the HR
values in column E during those times. (Col D will contain multiple sets of
times which aren't sortable, but only one set will contain times close to the
Start/Stop times.)
I've tried INDEX and MATCH functions but but can't get it to work properly.

A B C D E
1 Elapsed Time HR
2
3 0:09:25 19:35:19 59
4Start 15:42:30 0:09:30 19:35:24 63
5End 15:43:06 0:09:35 19:35:29 69
6HR 0:09:40 19:35:34 69
7 0:09:45 19:35:39 65.5
8
9 Subject: XX
10 Name J
11 Date of Birth : 9/9/1999 Patient ID : X
12
13 Elapsed Time Time HR
14
15 0:00:00 15:42:27 80.5
16 0:00:05 15:42:32 82
17 0:00:10 15:42:37 66.5
18 0:00:15 15:42:42 74.5
19 0:00:20 15:42:47 69
20 0:00:25 15:42:52 70
21 0:00:30 15:42:57 64
22 0:00:35 15:43:02 67
23 0:00:40 15:43:07 78
24 0:00:45 15:43:12 81
25 0:00:50 15:43:17 86


Thank you for any help you can give me.

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Lookup and average data in an unsorted list

Try this in B6, array-entered, ie press CTRL+SHIFT+ENTER to confirm the
formula (instead of just pressing ENTER):
=AVERAGE(IF((D1:D25=B4)*(D1:D25<=B5),E1:E25))
where B4 = starttime, B5 = endtime
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:27,000 Files:200 Subscribers:70
xdemechanik
---


"James A" wrote:

I'm trying to average a varying number of values based on the information in
cells giving the beginning and ending times (which will not exactly match the
data). The data array contains blank lines and can't be re-sorted.
In the fragment below, starting and stopping times are given in cells B4 and
B5. I need the formula to search column D (i.e. D1:D24) for the times
closest (or the next earlier) to the start and stop times and average the HR
values in column E during those times. (Col D will contain multiple sets of
times which aren't sortable, but only one set will contain times close to the
Start/Stop times.)
I've tried INDEX and MATCH functions but but can't get it to work properly.

A B C D E
1 Elapsed Time HR
2
3 0:09:25 19:35:19 59
4Start 15:42:30 0:09:30 19:35:24 63
5End 15:43:06 0:09:35 19:35:29 69
6HR 0:09:40 19:35:34 69
7 0:09:45 19:35:39 65.5
8
9 Subject: XX
10 Name J
11 Date of Birth : 9/9/1999 Patient ID : X
12
13 Elapsed Time Time HR
14
15 0:00:00 15:42:27 80.5
16 0:00:05 15:42:32 82
17 0:00:10 15:42:37 66.5
18 0:00:15 15:42:42 74.5
19 0:00:20 15:42:47 69
20 0:00:25 15:42:52 70
21 0:00:30 15:42:57 64
22 0:00:35 15:43:02 67
23 0:00:40 15:43:07 78
24 0:00:45 15:43:12 81
25 0:00:50 15:43:17 86


Thank you for any help you can give me.

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
unsorted lookup j.ruderman[_2_] Excel Worksheet Functions 2 September 18th 08 07:42 AM
Lookup unsorted list why-J Excel Discussion (Misc queries) 7 July 24th 08 10:57 AM
lookup unsorted list sslenterprises Excel Discussion (Misc queries) 2 October 25th 05 09:24 AM
Average from 2 unsorted lists KevinE Excel Worksheet Functions 3 August 11th 05 07:48 PM
Matching unsorted lookup values chrisrowe_cr Excel Worksheet Functions 4 July 25th 05 04:57 AM


All times are GMT +1. The time now is 07:07 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"