Extract rows with max values

pthwaites

New Member
Joined
Apr 14, 2020
Messages
13
Office Version
  1. 365
Platform
  1. Windows
Hi all,

In the attached picture, the first column shows a word which was used as a stimulus word for a language experiment. In the rows are response words given to these stimuli. I want to extract the row for each stimulus word which has the maximum column E value. I would like Excel to return this to me in a new sheet, which would contain only one row per stimulus word. For example, the row for the stimulus word "a" would contain only "an" (and the data from each of the other 3 columns); the row for "aardvark" would contain only "animal", and the row for "abacus" would contain only "math".

Can anyone help?

Thanks

Peter
 

Attachments

  • Data sample.jpg
    Data sample.jpg
    169.4 KB · Views: 12

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Hi & welcome to MrExcel.
How about
=FILTER(sheet1!A2:E25,(sheet1!E2:E25=MAXIFS(sheet1!E2:E25,sheet1!A2:A25,sheet1!A2:A25)))
 
Upvote 0
Hi & welcome to MrExcel.
How about
=FILTER(sheet1!A2:E25,(sheet1!E2:E25=MAXIFS(sheet1!E2:E25,sheet1!A2:A25,sheet1!A2:A25)))

Thanks for the reply. This works out fine for "a", but the problem is that the complete table comprises around 480,000 rows and around 12,000 stimulus words. I can't therefore manually enter data ranges for each stimulus word (e.g. A2:A25). I need excel to figure out for itself what the appropriate range for each stimulus word is.
 
Upvote 0
No need, that formula will do it all for you

+Fluff.xlsm
ABCDEFGHIJKLMN
1
2a1c1d10.013026a3c3d30.084837
3a2c2d20.057423b24c24d240.096188
4a3c3d30.084837
5a4c4d40.059011
6a5c5d50.035917
7a6c6d60.064637
8a7c7d70.017451
9a8c8d80.027143
10a9c9d90.012106
11a10c10d100.009854
12b11c11d110.065155
13b12c12d120.015561
14b13c13d130.05744
15b14c14d140.037995
16b15c15d150.086806
17b16c16d160.067836
18b17c17d170.086431
19b18c18d180.052592
20b19c19d190.012281
21b20c20d200.026032
22b21c21d210.074172
23b22c22d220.086053
24b23c23d230.010159
25b24c24d240.096188
26
Report
Cell Formulas
RangeFormula
J2:N3J2=FILTER(A2:E25,(E2:E25=MAXIFS(E2:E25,A2:A25,A2:A25)))
Dynamic array formulas.
 
Upvote 0
No need, that formula will do it all for you

Oh wow, that's amazing! But it now appears that I don't know how to paste the formula into my new sheet. If I simply paste it into multiple cells, all I get is the results for "a". If I fill down to other rows, I just get the same results for "a". How do I insert the formula into the sheet so that it applies to all of my stimulus words?
 
Upvote 0
You just put it into one cell, you will need to adjust the ranges to cover your entire data
 
Upvote 0
You just put it into one cell, you will need to adjust the ranges to cover your entire data

I'm confused. I said that there is too much data for me to manually enter the data ranges - I can't adjust 12,000 formulas. But you said that the formula would do that for me. What have I misunderstood?
 
Upvote 0
You just need to extend the ranges in the formula to cover the entire data, so if your data is from A2 to E500, you would use
=FILTER(Sheet1!A2:E500,(Sheet1!E2:E500=MAXIFS(Sheet1!E2:E500,Sheet1!A2:A500,Sheet1!A2:A500)))
 
Upvote 0
You just need to extend the ranges in the formula to cover the entire data, so if your data is from A2 to E500, you would use
=FILTER(Sheet1!A2:E500,(Sheet1!E2:E500=MAXIFS(Sheet1!E2:E500,Sheet1!A2:A500,Sheet1!A2:A500)))

Success! Thank you so much for your help!
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,728
Members
448,987
Latest member
marion_davis

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top