Average value by minimum path rule and with updating/changing criteria

Krabben

New Member
Joined
Aug 19, 2020
Messages
12
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Hey

I'm looking for some help to make my life and thesis run abit smoother :)

So basically i'm looking for a formula that can find the average in a particular way with a updating/changing criteria.
  1. Lets say i have a data set ranging from B1:B10
  2. I have to average the dataset by using a "minimum path rule", starting from the highest cell number (B10 - Cell value 20 in the picture) and then working towards B1.
  3. With "minimum path rule" i mean, that any cell value higher than the previously minimum cell value, should be excluded from the equation.
I hope my question is understandable :) If possible i would like to avoid a helper coloumn, since my dataset changes constantly.

Anmærkning 2020-08-19 001523.jpg


Any ideas?



Thanks
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Welcome to the MrExcel forum!

Try:

Book1
BCD
18
212
36
414
516
6814.66667
717
818
919
1020
Sheet9
Cell Formulas
RangeFormula
D6D6=AVERAGE(IF(B1:B10<=SUBTOTAL(5,OFFSET(B1,ROW(B1:B10)-ROW(B1),0,ROW(B10)-ROW(B1:B10)+1)),B1:B10))
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Welcome to the MrExcel forum!

Try:

Book1
BCD
18
212
36
414
516
6814.66667
717
818
919
1020
Sheet9
Cell Formulas
RangeFormula
D6D6=AVERAGE(IF(B1:B10<=SUBTOTAL(5,OFFSET(B1,ROW(B1:B10)-ROW(B1),0,ROW(B10)-ROW(B1:B10)+1)),B1:B10))
Press CTRL+SHIFT+ENTER to enter array formulas.


Hey Eric

Thank you - your formula worked perfectly!

Cheers :)
 
Upvote 0
Welcome to the MrExcel forum!

Try:

Book1
BCD
18
212
36
414
516
6814.66667
717
818
919
1020
Sheet9
Cell Formulas
RangeFormula
D6D6=AVERAGE(IF(B1:B10<=SUBTOTAL(5,OFFSET(B1,ROW(B1:B10)-ROW(B1),0,ROW(B10)-ROW(B1:B10)+1)),B1:B10))
Press CTRL+SHIFT+ENTER to enter array formulas.

Might aswell throw you an additional question, since you know a thing or two about excel :)

Lets say i have a cell value of 10 from another dataset. Now i want the formula to exclude the values 20,19,18,17, so the average count start at 8. (So the average only counts 8 and 6)

Is that possible?
 
Upvote 0
Might aswell throw you an additional question, since you know a thing or two about excel :)

Lets say i have a cell value of 10 from another dataset. Now i want the formula to exclude the values 20,19,18,17, so the average count start at 8. (So the average only counts 8 and 6)

Is that possible?


I have another question, which i should have posted with post #5 :ROFLMAO:

If i simply want the formula to start at B1 (Cell value 8) and "run" towards B10, what should i do?

I apologize for my somewhat simple questions, but this could really be a time saver :p
 
Upvote 0
For your first question, try:

Book1
BCD
18
212
36
414
516Minimum path average
687
717
818Cap
91910
1020
Sheet9
Cell Formulas
RangeFormula
D6D6=AVERAGE(IF(B1:B10<D9,IF(B1:B10<=SUBTOTAL(5,OFFSET(B1,ROW(B1:B10)-ROW(B1),0,ROW(B10)-ROW(B1:B10)+1)),B1:B10)))
Press CTRL+SHIFT+ENTER to enter array formulas.


And I don't quite understand what you want with your second question. Do you mean that you want the formula in C1, and that as you drag it down, you want C2, C3, etc. to calculate the result using the B column data up to that point?
 
Upvote 0
For your first question, try:

Book1
BCD
18
212
36
414
516Minimum path average
687
717
818Cap
91910
1020
Sheet9
Cell Formulas
RangeFormula
D6D6=AVERAGE(IF(B1:B10<D9,IF(B1:B10<=SUBTOTAL(5,OFFSET(B1,ROW(B1:B10)-ROW(B1),0,ROW(B10)-ROW(B1:B10)+1)),B1:B10)))
Press CTRL+SHIFT+ENTER to enter array formulas.


And I don't quite understand what you want with your second question. Do you mean that you want the formula in C1, and that as you drag it down, you want C2, C3, etc. to calculate the result using the B column data up to that point?

Thank you again :)

Regarding my question, i simply want the nr. 2 point in question #1 changed to

2. I have to average the dataset by using a "minimum path rule", starting from the lowest cell number (B1 - Cell value 8 in the picture) and then working towards B10.

The solution could be very simple, but i think i have confused myself abit :LOL:

Thank you again Eric, you're a lifesaver
 
Upvote 0
I see, try:

Book1
BCDE
18
212
36
414
516Minimum path average
6814.666677
717
818Cap
91999
1020
Sheet1
Cell Formulas
RangeFormula
D6D6=AVERAGE(IF(B1:B10<D9,IF(B1:B10<=SUBTOTAL(5,OFFSET(B1,ROW(B1:B10)-ROW(B1),0,ROW(B10)-ROW(B1:B10)+1)),B1:B10)))
E6E6=AVERAGE(IF(B1:B10<D9,IF(B1:B10<=SUBTOTAL(5,OFFSET(B1,0,0,ROW(B1:B10))),B1:B10)))
Press CTRL+SHIFT+ENTER to enter array formulas.


The E6 formula should do that. On this data set, it just includes 8 and 6.
 
Upvote 0
I see, try:

Book1
BCDE
18
212
36
414
516Minimum path average
6814.666677
717
818Cap
91999
1020
Sheet1
Cell Formulas
RangeFormula
D6D6=AVERAGE(IF(B1:B10<D9,IF(B1:B10<=SUBTOTAL(5,OFFSET(B1,ROW(B1:B10)-ROW(B1),0,ROW(B10)-ROW(B1:B10)+1)),B1:B10)))
E6E6=AVERAGE(IF(B1:B10<D9,IF(B1:B10<=SUBTOTAL(5,OFFSET(B1,0,0,ROW(B1:B10))),B1:B10)))
Press CTRL+SHIFT+ENTER to enter array formulas.


The E6 formula should do that. On this data set, it just includes 8 and 6.

Hey again Eric

I've been trying to implement the E6 formula into my document.

It seems to be working if the dataset is in the cells B1:B10.
But if I move it to B11:B20, it skips the number 8 and therefore the average simply becomes 6.

Can you help me fix that? :)
 
Upvote 0

Forum statistics

Threads
1,215,372
Messages
6,124,535
Members
449,169
Latest member
mm424

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