Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 6
Default MAXIF style function

I need a function that works just like COUNTIF or SUMIF but is MAXIF instead.

Basically

A B
Dog 5
Dog 6
Cat 7
Bird 2
Cat 5

I want to look for Dog in Column A and get the max value associate with
those rows in Column B. I am thinking I can do this with an Array Function,
but can't seem to get my head arround it.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 698
Default MAXIF style function

Here are a couple options:

This is an ARRAY FORMULA (commit with ctrl+shift+enter)
=MAX(IF(A2:A10="Dog",B2:B10))

This is a regular formula:
=MAX(INDEX((A2:A10="Dog")*B2:B10-(A2:A10<"Dog")*MIN(B2:B10),0))

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"CindyC" wrote:

I need a function that works just like COUNTIF or SUMIF but is MAXIF instead.

Basically

A B
Dog 5
Dog 6
Cat 7
Bird 2
Cat 5

I want to look for Dog in Column A and get the max value associate with
those rows in Column B. I am thinking I can do this with an Array Function,
but can't seem to get my head arround it.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 698
Default MAXIF style function

Even though CindyC got her answer, I thought I'd correct the 2nd formula in
my post....

This erroneous one:
=MAX(INDEX((A2:A10="Dog")*B2:B10-(A2:A10<"Dog")*MIN(B2:B10),0))

Should be this:
=MAX(INDEX((A2:A10="Dog")*B2:B10+(A2:A10<"Dog")*M IN(B2:B10),0))
.....(the "B10-" changed to "B10+")

Now the corrected formula behaves like the original ARRAY FORMULA I posted
and properly handles negative values in the Col_B range.
***********
Regards,
Ron

XL2002, WinXP


"Ron Coderre" wrote:

Here are a couple options:

This is an ARRAY FORMULA (commit with ctrl+shift+enter)
=MAX(IF(A2:A10="Dog",B2:B10))

This is a regular formula:
=MAX(INDEX((A2:A10="Dog")*B2:B10-(A2:A10<"Dog")*MIN(B2:B10),0))

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"CindyC" wrote:

I need a function that works just like COUNTIF or SUMIF but is MAXIF instead.

Basically

A B
Dog 5
Dog 6
Cat 7
Bird 2
Cat 5

I want to look for Dog in Column A and get the max value associate with
those rows in Column B. I am thinking I can do this with an Array Function,
but can't seem to get my head arround it.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Max IF function.

Ron,

The below formula works in case column A has text value. If my col A has numerical value , how can i write the formula to find max value in Col B ???


=MAX(INDEX((A2:A10="Dog")*B2:B10+(A2:A10<"Dog")*M IN(B2:B10),0))


Thanks in advance

BK
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
BK BK is offline
external usenet poster
 
Posts: 2
Default Excel Maxif function

Ron,

The below formula works in case column A has text value. If my col A has numerical value , how can i write the formula to find max value in Col B ???


=MAX(INDEX((A2:A10="Dog")*B2:B10+(A2:A10<"Dog")*M IN(B2:B10),0))


Thanks in advance

BK


  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 6
Default MAXIF style function

Oh I figured it out.
MAX(IF(A1:A5="DOG",B1:B5))

cntl+shift+enter

Cindy


"CindyC" wrote:

I need a function that works just like COUNTIF or SUMIF but is MAXIF instead.

Basically

A B
Dog 5
Dog 6
Cat 7
Bird 2
Cat 5

I want to look for Dog in Column A and get the max value associate with
those rows in Column B. I am thinking I can do this with an Array Function,
but can't seem to get my head arround it.

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default MAXIF style function

=SUMPRODUCT(MAX((A1:A5="Dog")*B1:B5))

"CindyC" wrote:

I need a function that works just like COUNTIF or SUMIF but is MAXIF instead.

Basically

A B
Dog 5
Dog 6
Cat 7
Bird 2
Cat 5

I want to look for Dog in Column A and get the max value associate with
those rows in Column B. I am thinking I can do this with an Array Function,
but can't seem to get my head arround it.

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 12
Default MAXIF style function, MINIF

I have been looking for a similar function , trying to find the Minimum
values from a list, and this one gave me #VALUE errors. It does work on a
fixed test set but not when I tried it on a test data page using equal sized
named data.

=SUMPRODUCT(MAX((namelist=C2)*monthlist)) Note: namelist is a list of
names, monthlist is date values and is the same size as name list. C2 holds
the current name being searched.

Did I miss something?

"Teethless mama" wrote in message
...
=SUMPRODUCT(MAX((A1:A5="Dog")*B1:B5))

"CindyC" wrote:

I need a function that works just like COUNTIF or SUMIF but is MAXIF
instead.

Basically

A B
Dog 5
Dog 6
Cat 7
Bird 2
Cat 5

I want to look for Dog in Column A and get the max value associate with
those rows in Column B. I am thinking I can do this with an Array
Function,
but can't seem to get my head arround it.



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
Looking for the equivalent of a Maxif function PerplexedinKY Excel Discussion (Misc queries) 6 January 20th 07 03:57 AM
How do I change sheet notation from R1C1 style to A1 style in XL 2 Sherlock1506 Setting up and Configuration of Excel 1 December 5th 06 03:22 PM
"MAXIF" Equivalent function in Excel Vital Miranda Excel Worksheet Functions 5 September 27th 06 11:56 PM
I need a productif style function Mitch Excel Worksheet Functions 4 May 4th 06 05:50 PM
Can a style be applied using a function? bobock Excel Worksheet Functions 1 December 29th 05 06:35 PM


All times are GMT +1. The time now is 11:58 PM.

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

About Us

"It's about Microsoft Excel"