Find MAX of column from using 2 criterias
Hi,
Try this array formula.
=MIN(IF(MONTH(A1:A20)=D1,IF(B1:B20=E1,C1:C20)))
Change MIN to MAX to get the max value
D1 is a number i.e. 4 for April and E1 is the reg No you want. You can then
do a simple subtraction to get the mileage.
This is an array formula which must be entered by pressing CTRL+Shift+Enter
'and not just Enter. If you do it correctly then Excel will put curly brackets
'around the formula {}. You can't type these yourself. If you edit the formula
'you must enter it again with CTRL+Shift+Enter.
--
Mike
When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.
"Sunnyskies" wrote:
Spreadsheet (duh) with 3 columns:
Month, Vehicle Licence #, Odometer readings.
Now looking at the Month and Vehicle Licence #, what is the lowest odometer
reading and also what is the highest odometer reading, so as to calculate the
distance travelled.
Do not want to use Pivot tables - as columns will grow.
Do not want to use array formula as end user is as useless as putting butter
on bread with a toothpick.
Thanks in advance.
|