I'm looking for a way to make smart formulas that I can copy and paste instead of editing the row references in all my formulas by hand. I've been trying ADDRESS, INDIRECT and a number of other approaches without any success.
I want to turn a formula like this one on row 8 (with hard coded "G6" and "F6" references) into something that can figure out how many rows above its location it should begin.
Code: Select all
{=AVERAGE(IF(G6:G8>$G$1,F6:F8, ""))}Code: Select all
{=AVERAGE(IF(indirect(ADDRESS(ROW()-I24+1,7,4,1)&":"&ADDRESS(ROW(),7,4,1))>$G$1,indirect(ADDRESS(ROW()-I24+1,6,4,1)&":"&ADDRESS(ROW(),6,4,1)),""))}Here's an example:
Code: Select all
Criteria 7.5
(quality > x)
Date Sequence Machine Data Quality
10:01:00 AM 1 a 2557.4 9.46
10:02:00 AM 2 a 2280.99 7.17
10:03:00 AM 3 a 990.55 9.77
10:04:00 AM 1 b 619.62 8.36
10:05:00 AM 2 b 754.52 4.42
10:06:00 AM 3 b 724.54 8.86
10:07:00 AM 4 b 735.03 4.41
10:08:00 AM 1 a 397.8 9.73
10:09:00 AM 2 a 605.81 4.11
10:10:00 AM 1 b 864.05 7.18
10:11:00 AM 2 b 741.88 6.3
10:12:00 AM 3 b 736.8 9.35
10:13:00 AM 4 b 823.35 8.58
10:14:00 AM 5 b 729.87 5.87
Begin End TestID Machine Mean Std Dev Attempted Valid
10:01:00 AM 10:03:00 AM 1 a 1773.975 1107.9302601022 3 2
10:04:00 AM 10:07:00 AM 2 b 672.08 74.1896434821 4 2
10:08:00 AM 10:09:00 AM 3 a 397.8 #DIV/0! 2 1
Commentary on the example:
The criteria is a value I plug in to see live updates in the spreadsheet. It is meant to select only rows that have a quality value above the criteria I plug in.
The first table is just values (no formulas).
The second table groups/summarizes, selects and then statistically describes the data in the first table. One row in this table summarizes/groups N rows from the table above with sequence values starting at 1 and going to N. At the next 1, a new row in the 2nd table is needed.
Here are some example formulas related to the 2nd table (along with my comments about what is lacking):
column: Machine
=E8
=E12
=E14
I need a way, based on the sequence value, to have this pick up the value from the last row.
Formulas for the Mean Column:
{=AVERAGE(IF(G6:G8>$G$1,F6:F8, ""))}
{=AVERAGE(IF(G9:G12>$G$1,F9:F12, ""))}
{=AVERAGE(IF(G13:G14>$G$1,F13:F14, ""))}
Presently I would have to edit the row values in the formulas by hand each for each new row I insert in the 2nd table. There are many thousands of them, so hand editing doesn't work!
column: Attempted
same exact issue as the "Machine" column.
column: Valid
Here's one example formula:
{=COUNT(IF(G6:G8>$G$1,1, ""))}
It has the same problems as the average formula.