A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Find MAX of column from using 2 criterias



 
 
Thread Tools Display Modes
  #1  
Old April 16th, 2010, 10:03 AM posted to microsoft.public.excel.misc
Sunnyskies
external usenet poster
 
Posts: 110
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  
Old April 16th, 2010, 10:13 AM posted to microsoft.public.excel.misc
Mike H
external usenet poster
 
Posts: 8,419
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  
Old April 16th, 2010, 10:21 AM posted to microsoft.public.excel.misc
Mike H
external usenet poster
 
Posts: 8,419
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  
Old April 16th, 2010, 05:12 PM posted to microsoft.public.excel.misc
T. Valko
external usenet poster
 
Posts: 15,759
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 15E1)+(B2:B15F1))*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.



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:12 AM.


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