Solved

# excel formula

Posted on 2011-03-09
331 Views
Please can you help with the formula in sheet2 D11

I want to return the Max number within the 'filtered' dates (D5:D6)

So the result should equal 12

help.xls
0
Question by:Gazza83
• 3

LVL 81

Expert Comment

I can't tell exactly what you are trying to do from the example but is you want to only look at filtered values then use the SUMPRODUCT function as described below.

The SUBTOTAL function provides various aggregate functions such as SUM and AVERAGE that ignore hidden rows in AutoFilter lists. The following parameter values only ignore rows hidden with the AutoFilter function and are compatible with all versions of Excel.

1 - AVERAGE
2 - COUNT
3 - COUNTA
4 - MAX
5 - MIN
6 - PRODUCT
7 - STDEV
8 - STDEVP
9 - SUM
10 - VAR
11 - VARP

In Excel 2003 and later one of the features of the SUBTOTAL function is that it can, if specified, ignore any rows in the input range that are manually hidden. To use this feature specify one of the parameter values listed below for the first parameter. Note that SUBTOTAL ignores rows hidden using AutoFilter regardless of what the parameter is.

101 - AVERAGE
102 - COUNT
103 - COUNTA
104 - MAX
105 - MIN
106 - PRODUCT
107 - STDEV
108 - STDEVP
109 - SUM
110 - VAR
111 - VARP

Kevin
0

LVL 50

Expert Comment

Hello,

the attached list is not filtered. To return the maximum number you can use

=max(D5:D6)

cheers, teylyn
0

Author Comment

I only want to return data that falls between the criteria listed in both D5:D6 "Stats table"

So the =SUMPRODUCT((Data!B14:B20000+0>=D5)*(Data!B14:B20000+0<=D6)* part is trying to match up the dates from D5:D6 with those in coumn B "Data" sheet

Unfortunatly if I use "=MAX(Data!X14:X2000)" this would return data that doesn't always fall between the dates in D5:D6

i.e B19 = 11/03/2010

0

LVL 81

Expert Comment

Use this array formula:

=MAX(IF((Data!B14:B20000>=D5)*(Data!B14:B20000<=D6)>0,Data!B14:B20000,""))

Enter by pressing CTRL+SHIFT+ENTER.

Kevin
0

LVL 81

Accepted Solution

zorvek (Kevin Jones) earned 500 total points
Correction:

=MAX(IF((Data!B14:B20000>=D5)*(Data!B14:B20000<=D6)>0,Data!X14:X20000,""))

Kevin
0

## Featured Post

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…