output max/min from another worksheet

deuce

Active Member
Joined
Oct 6, 2006
Messages
346
Office Version
  1. 2007
I am requesting the creation of a formula that will output the max and min of the last 20 days from another worksheet, the problem is that the datasheet is automatically updated every 1 minute and filled with data going downwards. The data columns are C,D,E,F.

Is there a way to do this?

thanks and regards,
deuce
 
This formula works to give the average of the latest 20 records?. it is the one i am using now.

=AVERAGE(OFFSET(INDEX(Sheet1!A:A,MATCH(9.99999999999999E+307,Sheet1!A:A)),0,0,-MIN(COUNT(Sheet1!A:A),20)))

The min and max formula works also.

Now the sum product function is the one to complete for the time being the formula gives the correct result but i want it to use/examine the latest 7200 rows.

thanks and regards

deuce.
 
Upvote 0

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
This formula works to give the average of the latest 20 records?. it is the one i am using now.

=AVERAGE(OFFSET(INDEX(Sheet1!A:A,MATCH(9.99999999999999E+307,Sheet1!A:A)),0,0,-MIN(COUNT(Sheet1!A:A),20)))

The min and max formula works also.

Now the sum product function is the one to complete for the time being the formula gives the correct result but i want it to use/examine the latest 7200 rows.

thanks and regards

deuce.
Note that C10 and C11 implements calculations in order to specify the exact reference for the SumProduct formula...

In C10 enter:

=MATCH(9.999999999999999E+307,$E:$E)

In C11 enter:

=MIN(ROW($E$27)+7200,$C$10)

Now invoke...
Code:
=SUMPRODUCT(
    --($E$27:INDEX($E:$E,$C$11)>=C12),
    --($F$27:INDEX($F:$F,$C$11)<=C12))
 
Upvote 0
can it be done in such a way that the formula gives the results in the cell in which it is entered without the use of helper columns? I am running out of visible space. Additionally i forgot to mention that the reference range of cells are on sheet 1 not on the same sheet.

sorry for the error.

thanks and regards,
deuce.
 
Last edited:
Upvote 0
can it be done in such a way that the formula gives the results in the cell in which it is entered without the use of helper columns? I am running out of visible space. Additionally i forgot to mention that the reference range of cells are on sheet 1 not on the same sheet.

sorry for the error.

thanks and regards,
deuce.

Just two helper cells makes the calculation more efficient in case you need to copy the formula down...

Define BigNum by means of Insert | Name | Define or Formulas | Name Manager as referring to:

=9.99999999999999E+307

It's:

Either...

C10:

=MATCH(BigNum,Sheet1!$E:$E)

C11:

=MIN(ROW(Sheet1!$E$27)+7200,$C$10)

Then:

=SUMPRODUCT(
--(Sheet1!$E$27:INDEX(Sheet1!$E:$E,$C$11)>=C12),
--(Sheet1!$F$27:INDEX(Sheet1!$F:$F,$C$11)<=C12))

Or...

=SUMPRODUCT(
--(Sheet1!$E$27:INDEX(Sheet1!$E:$E,MIN(ROW(Sheet1!$E$27)+7200,MATCH(BigNum,Sheet1!$E:$E))))>=C12),
--(Sheet1!$F$27:INDEX(Sheet1!$F:$F,MIN(ROW(Sheet1!$E$27)+7200,MATCH(BigNum,Sheet1!$E:$E))))>=C12))

Or, even better...

Define also Lrow as referring to:

=MATCH(BigNum,Sheet1!$E:$E)

and invoke:

=SUMPRODUCT(
--(Sheet1!$E$27:INDEX(Sheet1!$E:$E,MIN(ROW(Sheet1!$E$27)+7200,Lrow)))>=C12),
--(Sheet1!$F$27:INDEX(Sheet1!$F:$F,MIN(ROW(Sheet1!$F$27)+7200,Lrow)))>=C12))
 
Upvote 0
hi thanks for responding, the formulas look intimidating but i will test them out.
 
Upvote 0
hi thanks for responding, the formulas look intimidating but i will test them out.

If you like to, we can work with named ranges. Such would make the formulas shorter and more readable.

Edit: In the last 2 SumProduct formulas, the second term must carry <=, not >=.
 
Upvote 0
Yes, this is exactly what I want (but you need to tell me how to modify the formula if the columns to analyze have changed). Sorry I have not been able to reply earlier as I was having technical difficulties.

thanks and regards,
deuce
OK, just to make sure we understand.

Let's assume this is your data:

Book1
CDEF
278352948
341296525
483502944
5881003490
610907169
72380118
813207122
95154236
1058372422
1156994614
127762569
132113815
1421447696
1563405934
1610173784
1729626721
1880969839
198778055
2045794542
2148506799
2215119537
232632825
245564089
259474970
268100451
Sheet1

I have highlighted the last 20 rows.

Is the highlighted area the range of cells you want to evaluate?

From this area, the last 20 rows, you want the MAX, MIN and AVERAGE?
 
Upvote 0
hi valko, we have progressed from min max average to sum product formulas.
 
Upvote 0
hi aladin, the sum product formula that you provided returns a count of 0 meaning it is not giving the correct results. what can we do to fix this problem?
 
Upvote 0
hi aladin, the sum product formula that you provided returns a count of 0 meaning it is not giving the correct results. what can we do to fix this problem?

Did you try this...

=SUMPRODUCT(
--(Sheet1!$E$27:INDEX(Sheet1!$E:$E,MIN(ROW(Sheet1!$E$27)+7200,Lrow)))>=C12),
--(Sheet1!$F$27:INDEX(Sheet1!$F:$F,MIN(ROW(Sheet1!$F$27)+7200,Lrow)))<=C12))

or something else?
 
Upvote 0

Forum statistics

Threads
1,224,587
Messages
6,179,738
Members
452,940
Latest member
Lawrenceiow

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