Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 49
Default FInding the largest number in a range meeting a criteria

Hmm... I though I'd understood how SUMPRODUCT works but clearly I haven't.
Basically what I want to do is just find the nth largest number in a range
where an adjacent range ="X". So if I have the following two columns (hope
the formatting sort of works):

A B
X 1
3
2
X 2
5
X 4

I thought I could somehow do this with
=LARGE(SUMPRODUCT(--(range1="X"),--(range2),n) But that just gives me the sum
of the values in range2 for which the value in range1 is "X" so obviously
SUMPRODUCT only returns a single number... I obviously don't get very far by
sticking LARGE inside the SUMPRODUCT, either... any ideas?

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 49
Default FInding the largest number in a range meeting a criteria

Naturally the formatting didn't work, but I'll try again. Anyway, with the
setup below I'd hope to get the formula to spit out 4:
A B
X 1
3
2
X 2
5
X 4


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default FInding the largest number in a range meeting a criteria

Try one of these array formula** :

=MAX(IF(A1:A10="x",B1:B10))

If you want the nth largest:

=LARGE(IF(A1:A10="x",B1:B10),n)

Where n = nth value

** 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


"Babymech" wrote in message
...
Hmm... I though I'd understood how SUMPRODUCT works but clearly I haven't.
Basically what I want to do is just find the nth largest number in a range
where an adjacent range ="X". So if I have the following two columns (hope
the formatting sort of works):

A B
X 1
3
2
X 2
5
X 4

I thought I could somehow do this with
=LARGE(SUMPRODUCT(--(range1="X"),--(range2),n) But that just gives me the
sum
of the values in range2 for which the value in range1 is "X" so obviously
SUMPRODUCT only returns a single number... I obviously don't get very far
by
sticking LARGE inside the SUMPRODUCT, either... any ideas?



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,722
Default FInding the largest number in a range meeting a criteria

Just need to find the LARGE before summing (as the sum of 1 number is that
number!)
=SUMPRODUCT(LARGE((Range1="x")*(Range2),n))
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Babymech" wrote:

Naturally the formatting didn't work, but I'll try again. Anyway, with the
setup below I'd hope to get the formula to spit out 4:
A B
X 1
3
2
X 2
5
X 4


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 695
Default FInding the largest number in a range meeting a criteria

=MAX(IF(A1:A7="X",B1:B7))

insert and hit ctrl+shift+enter

"Babymech" skrev:

Hmm... I though I'd understood how SUMPRODUCT works but clearly I haven't.
Basically what I want to do is just find the nth largest number in a range
where an adjacent range ="X". So if I have the following two columns (hope
the formatting sort of works):

A B
X 1
3
2
X 2
5
X 4

I thought I could somehow do this with
=LARGE(SUMPRODUCT(--(range1="X"),--(range2),n) But that just gives me the sum
of the values in range2 for which the value in range1 is "X" so obviously
SUMPRODUCT only returns a single number... I obviously don't get very far by
sticking LARGE inside the SUMPRODUCT, either... any ideas?

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
Finding the largest number help John Excel Discussion (Misc queries) 7 October 23rd 07 11:10 PM
Sum within a date range meeting one other criteria [email protected] Excel Worksheet Functions 3 January 28th 07 04:53 AM
Finding the Largest Number, based on two criteria BigH Excel Discussion (Misc queries) 1 February 8th 06 08:50 PM
Finding the median of numbers meeting criteria thekovinc Excel Discussion (Misc queries) 3 February 7th 06 12:45 AM
finding the largest number from the last row and look up its name. Jeff Excel Worksheet Functions 5 February 24th 05 10:40 PM


All times are GMT +1. The time now is 04:29 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"