JenniferMurphy
Well-known Member
- Joined
- Jul 23, 2011
- Messages
- 2,676
- Office Version
- 365
- Platform
- Windows
I have a spreadsheet for recording various medical metrics requested by my doctor (blood pressure, weight, etc). I have expressions for calculating the max (using MaxIfs), min (using MinIfs), and average (using AverageIfs) of a period of time. But I am having trouble coming up an expression for the number of readings. I tried to use CountIfs, but could not come up with an expression for the criteria. I also tried SumProduct as in the mini-sheet below, but that is also not working.
I would appreciate any help.
I would appreciate any help.
Book1 | |||||
---|---|---|---|---|---|
B | C | D | |||
4 | |||||
5 | Date | Systolic | |||
6 | 8/20/24 | 102 | |||
7 | 8/27/24 | ||||
8 | 8/30/24 | 97 | |||
9 | 9/15/24 | 113 | |||
10 | 9/22/24 | ||||
11 | 9/30/24 | 114 | |||
12 | 10/05/24 | ||||
13 | 10/15/24 | ||||
14 | 10/20/24 | 98 | |||
15 | Number of days | 30 | |||
16 | First day | 09/20/24 | |||
17 | Number of readings | 0 | |||
18 | Maximum | 114 | |||
19 | Average | 106 | |||
20 | Minimum | 98 | |||
Sheet1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
C16 | C16 | =TODAY()-NumDays |
D17 | D17 | =SUMPRODUCT((Table1[Date]>=(TODAY()-NumDays)), ISNUMBER(Table1[Systolic])) |
D18 | D18 | =MAXIFS(Table1[Systolic],Table1[Date],">=" & FirstDay) |
D19 | D19 | =AVERAGEIFS(Table1[Systolic],Table1[Date],">=" & FirstDay) |
D20 | D20 | =MINIFS(Table1[Systolic],Table1[Date],">=" & FirstDay) |
Named Ranges | ||
---|---|---|
Name | Refers To | Cells |
FirstDay | =Sheet1!$C$16 | D18:D20 |
NumDays | =Sheet1!$C$15 | D17, C16 |