Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 107
Default Find MAX of column from using 2 criterias

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.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default 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.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Find MAX of column from using 2 criterias

OOPs,

Just spotted

Do not want to use array formula as end user is as useless as putting butter
on bread with a toothpick.


I don't know how to do it without an array other than resorting to a UDF.
--
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.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Find MAX of column from using 2 criterias

Do not want to use Pivot tables
Do not want to use array formula


A2:A15 = month
B2:B15 = licence #
C2:C15 = odometer readings

E1 = lookup month
F1 = lookup licence #

The max is fairly easy:

=SUMPRODUCT(MAX((A2:A15=E1)*(B2:B15=F1)*C2:C15))

The min is a bit convoluted:

=MIN(INDEX(((A2:A15=E1)*(B2:B15=F1)*C2:C15)+((A2:A 15<E1)+(B2:B15<F1))*1E+100,0))

You could use array formulas and include a reminder for the user:

Array entered** :

=MIN(IF(A2:A15=E1,IF(B2:B15=F1,C2:C15)))+N("Array Entered - CSE")

=MAX(IF(A2:A15=E1,IF(B2:B15=F1,C2:C15)))+N("Array Entered - CSE")

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT
key then hit ENTER.

--
Biff
Microsoft Excel MVP


"Sunnyskies" wrote in message
...
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.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
FInd common data in one column then add number in adjacent column JT Excel Worksheet Functions 3 December 18th 09 10:20 PM
how do sum a column only if meets the criterias of 2 columns Lorenzo Excel Discussion (Misc queries) 3 March 13th 08 04:34 PM
find last row value in column when using MATCH to find column Bouce Excel Worksheet Functions 6 February 6th 08 10:16 PM
Find something in column a then find if column B matches criteria Darrell_Sarrasin via OfficeKB.com Excel Discussion (Misc queries) 8 November 28th 07 09:40 PM
Find First Non blank cell than find column header and return that value Silver Rose Excel Worksheet Functions 10 April 30th 07 05:56 PM


All times are GMT +1. The time now is 05:55 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"